[Mono-list] Group- and Decimal-Separator Problem

Jan Waiz hamburg at icomedv.de
Wed Feb 8 09:44:52 EST 2006


Hi All,

 

its me again :-)

 

I have a Problem using the correct Group- and Decimalseparator in an
ASP.NET-Application, when trying to parse a string that contains a numeric
value like:

 

string    sNum = "12,34";

decimal nNum = decimal.Parse( sNum ); // => 12,34

 

Now I am trying this:

 

string    sNum = "12.34";

decimal nNum = decimal.Parse( sNum ); // => 1234

 

 

I test a lot with NumberFormatInfo without successful Result. As well as
PostgreSQL is using a "." as Decimalseparator. I Germany we are using "," -
but what happens in other Countrys with different Settings?

 

All that when running in Windows - is there anything special when running in
Mono? For me it seems so, because trying something like that to use
Replace(".",",") - that cant be a good Solution :-)

 

I am todaly confused what is the correct/best Way to solve this Problem.
What are you doing?

 

Regards

Jan Waiz

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20060208/975cf495/attachment.html


More information about the Mono-list mailing list