Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Help with Numbers..Please

by Anonymous Monk
on Apr 24, 2003 at 10:03 UTC ( [id://252821]=note: print w/replies, xml ) Need Help??


in reply to Help with Numbers..Please

$number = sprintf("%06d", $number++);

Replies are listed 'Best First'.
Re: Re: Help with Numbers..Please
by bart (Canon) on Apr 24, 2003 at 16:00 UTC
    Close, but no cigar. This will increment the number after the returned value is used. Either of the next will do, as the modified value isn't being retained:
    $number = sprintf("%06d", ++$number); $number = sprintf("%06d", $number+1);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://252821]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2025-07-16 18:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.