how to handle culture in double parsing in c#? -



how to handle culture in double parsing in c#? -

i have question how handle civilization while parsing doubles. in scheme cost info various servers comes together. info thats given input varies in culture. 2 1000000 , 50 cents given : "2.000.000,50" "2,000,000.50" "2000000.50" "2000000,50"

is there generic way handle these various types of input ?

no, there no generic way. either need know civilization double formatted or servers need send in single format, invariantculture.

if guess culture, there's bad news waiting different cultures utilize different decimal separator, grouping separator etc. can't.

refer foresee can go wrong if guess.

c# parsing double culture

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -