Click here to Skip to main content
16,012,611 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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.
Like
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
etc
Plz Help Me
Posted
Comments
Thanks7872 27-Jul-15 3:05am    
Any effort? What have you tried? Any specific issue?

C#
double amonut_ = 2073635.00;
System.Globalization.CultureInfo objInfo = System.Globalization.CultureInfo.GetCultureInfo("hi-IN");
string str = amonut_.ToString("C2", objInfo);
txtAmount.Text = str;



XML
<div>
   <asp:TextBox ID="txtAmount" runat="server"></asp:TextBox>
   </div>



Output--------------

₹ 20,73,635.00
 
Share this answer
 
Try to set the CultureInfo object to "en-IN" in global.asax like below:

// Change current culture
CultureInfo 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[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900