JavaScript RegEx expresssion -
i need compose expression allow number or decimal point, 1 decimal.
allowed formats
100.00, 100
but not
'100d.00, a100, -100, 100.000.000.00'
for goal, far have this:
/[^0-9$.]/g
any community appreciated.
i think /^\d+(\.\d{2})?$/
should work. if need more 2 digits after decimal point /^\d+(\.\d+)?$/
.
Comments
Post a Comment