[thelist] javascript question on formatting numbers.

Alliax damiencola at wanadoo.fr
Thu Dec 20 16:15:14 CST 2001


Hello,

I would like to know if it is possible to format an integer to look like this:
00012 for integer 12

I know I could do
var = "000" + 12
and var would be "00012"

but I'd like to know if I can format the integer to be say 5 digits long,
whatever value it is, ie. "00421" for 421

thank you

Cordialement,

__ Alliax         ~CV : http://LingoParadise.com/cv.php
Un site pour Toulon : http://ToulonParadise.com
Un site pour Renaud : http://rfaucilhon.multimania.com
Un site pour Director : http://LingoParadise.com






More information about the thelist mailing list