Click here to Skip to main content
15,039,470 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need regular expression for indiam currency
(int & float value)
Posted

^\d*(.\d{2})?$
This will get precisely 2 digits after .
11.5 is not valid. 11.50 is.
You need to specify paise in two digits or just skip it.
e.g. 5, 10, 10.50 are valid values.
   
v2
That question is answered in one of the CP threads. Please check out this link.Regular Expression for Numeric value with multiple comma like currency in INR format[^]
   
MIDL
if(!Regex.IsMatch(textBox1.Text,@"^[0-9]{0,3}.?[0-9]{2}$"))

{

  //  Error Message

}

else

{



}
   
v2
Comments
Prerak Patel 28-Jul-11 1:14am
   
Indian currency has 2 digits. Isn't it?
uspatel 28-Jul-11 1:15am
   
yes,I have improved solution.
thanks for comments.

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