javascript timer with comma -


this question has answer here:

i want display dollar timer goes 1 2500. when timer increases 1000, want display $1,000 instead of $1000. want commas in thousands place.could me javascript.

thanks.

you regular expression.

var friendlynum = (num + "").replace(/^(\d)(\d{3})$/, "$1,$2"); 

note handle 1000 places.

how works exercise reader. learning how work, stat here.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -