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

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - cuda, pycuda -- how to write complex numbers -- errors:class "cuComplex" has no member "i" -

How do I check if an insert was successful with MySQLdb in Python? -