Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Help with Numbers..Please

by Anonymous Monk
on Apr 25, 2003 at 18:50 UTC ( [id://253220]=note: print w/replies, xml ) Need Help??


in reply to Help with Numbers..Please

Hi, If you want the zeros, you should pad these on when they are needed for display. When using the number, it will be simply a number. I have a requirement to do this on my project. I use this function that I wrote:
sub zeroPad () { my $number = $_[0]; my $charLength = $_[1]; if ($charLength > 10000) { return; } # Sanity Check my $tmp; # Front pad with zeros $tmp = $number; while ( length ($tmp) < $charLength ) { $tmp = "0" . $tmp; } return $tmp; } # end zeroPad

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2025-07-14 02:26 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.