Path: csiph.com!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Mel Smith" Newsgroups: comp.lang.javascript Subject: Re: Placing 'zeros' in front of a number ? Date: Sat, 23 Jun 2012 16:48:02 -0600 Lines: 23 Message-ID: References: <68f86607-2127-46c8-b59d-a0b010335f32@googlegroups.com> X-Trace: individual.net 0BEVBljcXWEH6DHZboG/BA+WoBMjy1WAiV0wvZc2SEj2rUuFwXVpVuk60fP4DtVbR/ Cancel-Lock: sha1:3Il44e9lh1iDGV4cRiLiQnO50tw= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Xref: csiph.com comp.lang.javascript:14636 Evertjan said: >> ("000" + number).substr(-4) >> >> already does the trick. > > Next to the above contacanating solution, > here the equivalent numeric addition solution: > > ( 60000 + number ).toString().substr(-4) > > or even > > ( 70000 + 15 + '' ).substr(-4) Evertjan: Thank you for this simple solution to my problem ! -Mel Smith