I have a variable $nfc_amt that I want to add leading zeroes to. The value of $nfc_amt is 115.
my code:
print "NFC_AMT before adding zeroes: $nfc_amt\n";
$nfc_amt = sprintf("%07d", $nfc_amt);
print "NFC_AMT after adding zeroes: $nfc_amt\n";
my result:
NFC_AMT before adding zeroes: 115
NFC_AMT after adding zeroes: 0000114
What am I doing wrong?
Thanks in advance for your help.
my code:
print "NFC_AMT before adding zeroes: $nfc_amt\n";
$nfc_amt = sprintf("%07d", $nfc_amt);
print "NFC_AMT after adding zeroes: $nfc_amt\n";
my result:
NFC_AMT before adding zeroes: 115
NFC_AMT after adding zeroes: 0000114
What am I doing wrong?
Thanks in advance for your help.