开发者

insert comma in decimal type

I Want to insert A comma into 开发者_高级运维adecimal type how i can do it ?


Replace it with a dot.

insert  YourTable
        (DecimalColumn)
select  replace('3,14',',','.')


This might be your answer - Formatting Numbers as Strings with Commas in place of Decimals

The top answer there is:

  string.Format(System.Globalization.CultureInfo.GetCultureInfo("de-DE"), "{0:0.0}", 4.3);


Decimal representation is completely depends on culture. So you need to provide appropriate culture during convertion, like in code below:

        double test = 8888.33;
        MessageBox.Show(string.Format(System.Globalization.CultureInfo.GetCultureInfo("EN-US"),"{0:0,0.0}",test));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜