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
Post a Comment