javascript - Regex add 0 after first decimal -
javascript - Regex add 0 after first decimal -
i learning regex need quite urgently.
i have set of values (10, 19.5, 13.99, 9.09)
. these formats fine except sec value.
my problem how rewrite 19.5 becomes 19.50
without affecting other entries i.e (10, 19.50, 13.99, 9.09)
many guys.
if these numbers, utilize tofixed()
if these strings, can use
num="19.5" num.replace(/^(\d+\.\d)$/,"$10");
javascript regex currency
Comments
Post a Comment