数字格式问题 [英] Number format problem

查看:58
本文介绍了数字格式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用

十进制数= 394049494;
字符串stramount = amount.ToString("##,##,##,###"));
Console.WriteLine(stramount);

但输出是
394,049,494

是什么原因.请帮助

i am using

decimal amount = 394049494;
string stramount = amount.ToString("##,##,##,###");
Console.WriteLine (stramount);

but the output is
394,049,494

what is the reason. Plz help

推荐答案

尝试使用两位数分隔将区域性指定为一个:

Try specifying the culture to one using two-digit separation:

CultureInfo ci = new CultureInfo("hi-IN");
stramount = amount.ToString("##,##,##,###", ci);
Console.WriteLine(stramount);


这篇关于数字格式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆