[kw-pm] sprintf Issue

Justin Wheeler kw-pm at datademons.com
Thu Jan 7 12:25:42 PST 2010


d means signed decimal integer.  signed decimal only goes up to 4294967295.

You'd probably do best just to use it as a string at that length:

printf("Formatted: %020s", $processId);

Justin


On Thu, 7 Jan 2010, Robert Pike wrote:

> Is there a limitation on trying to format numbers using sprintf? I'm trying to format a number like 10005000035, so as to have leading zeros up to a total length of 20 such as this :
>
> print "Formatted : " . sprintf("%020d", $processId);  # processId is equal to 10005000035
>
> Is there a problem with this approach or a better way of doing it? Thanks in advance for any feedback.
>
>
>      __________________________________________________________________
> Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail.  Click on Options in Mail and switch to New Mail today or register for free at http://mail.yahoo.ca
> _______________________________________________
> kw-pm mailing list
> kw-pm at pm.org
> http://mail.pm.org/mailman/listinfo/kw-pm
>


More information about the kw-pm mailing list