how to convert string to double with proper cultureinfo

Posted by Vinay Pandey on Stack Overflow See other posts from Stack Overflow or by Vinay Pandey
Published on 2010-04-06T07:49:24Z Indexed on 2010/04/06 7:53 UTC
Read the original article Hit count: 334

Hi All,

I have two nvarchar fields in database to store the DataType and DefaultValue, I have a DataType Double and value as 65.89875 in english format.

Now I want the user to see the value as per the selected browser language format (65.89875 in English should be displayed as 65,89875 in german). Now if the user edits from german format to 65,89875 which is 65.89875 equivalent in english, and the other user views from english browser it comes as 6589875.

This happens because in DB it was stored as 65,89875 and when converted using english culture it becomes 6589875 since it considers , as seperator.

Any Idea how I get this working for all the browsers?

© Stack Overflow or respective owner

Related posts about c#.net

Related posts about globalization