EWA Posted July 11, 2024 Posted July 11, 2024 Would anyone have a regex expression for currency field. I have the one below for number and decimal but want to add a currency sign ^((?=.*[1-9]|0)(?:\d{1,5}))((?=.*\d)(?:\.\d{3})?)*((?=.*\d)(?:\,\d\d){1}?){0,1}$
Steve Giller Posted July 11, 2024 Posted July 11, 2024 What currency? Just inserting a £ between the initial caret and the first bracket works for UK, other currrency symbols may need escaping, though. I think what you have uses the opposite to UK format, too (it needs a thousand separator of period, and pence delimiter of comma)- just checking that this is what you need?
Jim Posted July 11, 2024 Posted July 11, 2024 Just a slight modification on the ones provided by hornbill, if you are not aware these are in the form designer, then clicking the ? next to the regex validation ^[£]]?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$
samwoo Posted July 16, 2024 Posted July 16, 2024 On 11/07/2024 at 12:54, Jim said: Just a slight modification on the ones provided by hornbill, if you are not aware these are in the form designer, then clicking the ? next to the regex validation ^[£]]?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$ *Gasp* When was that Regex Selector introduced!? 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now