I am trying to formulate a regex expression in JavaScript to get the cents form a number that has a decimal point. For example, an expression that can get 27 from 454.2700000. I know how to do this with split and substring but is there an easier way using just a regular expression. Thanks
I am trying to formulate a regex expression in JavaScript to get the cents
Share
If you really have a number and you want a number, why use strings?
If n is a numeric string, multiplication converts it to a number: