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

后端 未结 5 1152
轮回少年
轮回少年 2021-02-08 11:11

c# decimal.toString() conversion problem

Example: I have a value in decimal(.1) when I convert decimal to string using toString() it return

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-08 11:26

    you have to define the format, it will depend in your local setting or define the format, using something like this

    decimal.ToString(System.Globalization.CultureInfo.CreateSpecificCulture("en-us"));
    

    cheers

提交回复
热议问题