in reply to sprintf() returning incorrect value
Can't reproduce:
my $nfc_amt = 115; print "NFC_AMT before adding zeroes: $nfc_amt\n"; $nfc_amt = sprintf("%07d", $nfc_amt); print "NFC_AMT after adding zeroes: $nfc_amt\n"; __END__ NFC_AMT before adding zeroes: 115 NFC_AMT after adding zeroes: 0000115
Likely it doesn't contain what you think it contains. Could you add this to your code and show us the output: use Devel::Peek; Dump($nfc_amt);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sprintf() returning incorrect value
by ppeel (Novice) on Jul 15, 2015 at 15:24 UTC |