Hi I have a ruby regex I made usinig Rubular
http://rubular.com/r/RRc8twB6NL which is meant to check for a decimal 10.00 for pricing. I get it to work on Rubular, but in my application this code does not work:
validates_format_of :price, :with=>/^([0-9]{1,}\.{0,}[0-9]{0,2})$/
Thanks for any help
In case you only want to have prices with one digit and then zeros you need the regex
If any number is allowed before the decimal dot it is
If the fraction part is optional it is either of
If you want to allow for the dollar sign (maybe with spaces in between) it is either of