954,315 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Decimal.ToString() always adds .00 on one of the servers

I have a C# web application installed in 3 servers. The access to this application is balanced. The third server was included recently and since then i have had some issues.

When a webservice call is made in the first two severs, they assume that the decimal.ToString() method does not include unnecessary decimal digits, while the 3rd server always sends the number plus ".00".

Example:
1st and 2nd server: (100).ToString() » "100"
3rd server: (100).ToString() » "100.00"

I've compared the site Properties in the IIS, the regional settings, the registry and the files in all three servers and they are the same.

The problem is that the webservice returns an error when receiving that information and i wanted to know how to solve this, since the problem is only appearing on one server. I wanted to correct this on the server instead of programaticaly because there are more applications in that server (other than mine) and they will eventually crash because of this.

Nunni
Newbie Poster
1 post since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

I would suggest to put a second eye on the installed languages, the supported codes, and the one used as default language, the default keyboard, and in the regional settings the default number of decimal places for numeric formats.

Also, if the output format is a requirement, i will suggest not to use the default output of ToString() but the appropiate formatting instead.

Hope this helps.

lolafuertes
Master Poster
788 posts since Oct 2008
Reputation Points: 120
Solved Threads: 166
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You