in reply to sprintf() returning incorrect value

How do you populate $nfc_amt? Are you sure it's really 115 integer?
my $n = 114.9999999999999; print "$n\t", sprintf "%07d\n", $n; __END__ Output: 115 0000114
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: sprintf() returning incorrect value
by ppeel (Novice) on Jul 15, 2015 at 15:29 UTC

    I retrieve it from a DB2 table.