I need to change my website to another server. My application was programmed with the decimal point "." as decimal separator and date format yyy-mm-dd
Now on my new server the decimal point is the "," symbol. I have a lot of math calculation and now I have to change my all code (because the decimal separator changed)?
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
423 Points
970 Posts
Changed from server now decimal places and data format are different
May 31, 2018 05:45 PM|mariolopes|LINK
Hi
I need to change my website to another server. My application was programmed with the decimal point "." as decimal separator and date format yyy-mm-dd
Now on my new server the decimal point is the "," symbol. I have a lot of math calculation and now I have to change my all code (because the decimal separator changed)?
Thank you
https://programamos.pt
Star
9831 Points
3120 Posts
Re: Changed from server now decimal places and data format are different
Jun 01, 2018 06:35 AM|Brando ZWZ|LINK
Hi mariolopes,
As far as I know, we could set the decimal point on that server by modify the region setting in control panel.
We coud locate the Control panel ---> Region ---> Additional Settings to modify the decimal symbol and the date.
I suggest you could contack with your server administrator to modify the regon setting.
More details, you could refer to below article:
https://docs.microsoft.com/en-us/globalization/locale/number-formatting
Best Regards,
Brando
All-Star
48290 Points
17991 Posts
Re: Changed from server now decimal places and data format are different
Jun 01, 2018 06:59 AM|PatriceSc|LINK
Hi,
It seems in a change in the default culture in use. Try https://msdn.microsoft.com/en-us/library/bz9tc508.aspx to force the culture you want to use for your site.
Or you were using "auto" and your browser culture changed?
Member
423 Points
970 Posts
Re: Changed from server now decimal places and data format are different
Jun 01, 2018 06:35 PM|mariolopes|LINK
The admin can change the region setting because it will alter all the others mysql files
The culture doesn't seems to work. I have to insert data in Mysql databases and I got errors In code like this one
I think I have to redo all the work
https://programamos.pt
All-Star
48290 Points
17991 Posts
Re: Changed from server now decimal places and data format are different
Jun 01, 2018 07:15 PM|PatriceSc|LINK
How does it fail exactly ? What is the current culture ?
If the same culture is used when converting a decimal to a string and then this string to a decimal it should work.