Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# decimal toString() conversion with comma(,)

c# decimal.toString() conversion problem

Example: I have a value in decimal(.1) when I convert decimal to string using toString() it returns (0,10). Instead of .(DOT) it returns ,(COMMA).

like image 970
sivaprakash Avatar asked Jun 17 '15 10:06

sivaprakash


1 Answers

I believe this is to do with the culture/region which your operating system is set to. You can fix/change the way the string is parsed by adding in a format overload in the .ToString() method.

For example

decimalValue.ToString(CultureInfo.InvariantCulture);
like image 200
Ralt Avatar answered Nov 10 '22 12:11

Ralt