本文介绍了金额应以TextBox中的印度金额格式显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在使用Dev Express Control。我在文本框掩码设置中遇到问题我想要输入金额应该以印度金额格式显示。 喜欢 1000 = 1,000.00 ///////// One Thousnd 10000 = 10,000.00 ///////// Ten Thousnd 100000 = 1,00,000.00 ///////// One Lakh 1000000 = 10,00,000.00 ///////// Ten Lakh 等 Plz帮助我解决方案 尝试在global.asax中将CultureInfo对象设置为en-IN,如下所示: //改变现有文化 CultureInfo文化; if(Thread.CurrentThread.CurrentCulture.Name ==en-US) culture = CultureInfo.CreateSpecificCulture(en-IN); else culture = CultureInfo.CreateSpecificCulture(en-IN); Thread.CurrentThread.CurrentCulture = culture; Thread.CurrentThread.CurrentUICulture = culture; 还要检查Dev Express上的蒙面文本框示例: https://demos.devexpress.com/ASPxEditorsDemos/Features/MaskedInput.aspx [ ^ ] double amonut_ = 2073635 。 00 ; System.Globalization.CultureInfo objInfo = System.Globalization.CultureInfo.GetCultureInfo( hi-IN); string str = amonut_.ToString( C2,objInfo); txtAmount.Text = str; < div > < asp:TextBox ID = txtAmount runat = 服务器 > < / asp: TextBox > < / div > 输出-------------- $ 20 ,73,635.00 Hi ,I am using Dev Express Control.I have problem in Text Box Mask Setting I want Enter Amount Should be display in Indian Amount Format.Like1000 = 1,000.00 /////////One Thousnd10000=10,000.00 /////////Ten Thousnd100000=1,00,000.00 /////////One Lakh1000000= 10,00,000.00 /////////Ten Lakhetc Plz Help Me 解决方案 Try to set the CultureInfo object to "en-IN" in global.asax like below:// Change current cultureCultureInfo culture;if (Thread.CurrentThread.CurrentCulture.Name == "en-US") culture = CultureInfo.CreateSpecificCulture("en-IN");else culture = CultureInfo.CreateSpecificCulture("en-IN");Thread.CurrentThread.CurrentCulture = culture;Thread.CurrentThread.CurrentUICulture = culture;Also check the masked text box sample at Dev Express:https://demos.devexpress.com/ASPxEditorsDemos/Features/MaskedInput.aspx[^]double amonut_ = 2073635.00;System.Globalization.CultureInfo objInfo = System.Globalization.CultureInfo.GetCultureInfo("hi-IN");string str = amonut_.ToString("C2", objInfo);txtAmount.Text = str;<div> <asp:TextBox ID="txtAmount" runat="server"></asp:TextBox> </div>Output--------------₹ 20,73,635.00 这篇关于金额应以TextBox中的印度金额格式显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-16 17:38