Perl Monk, Perl Meditation | |
PerlMonks |
Re^4: Padding with sprintf changing numberby syphilis (Archbishop) |
on Sep 24, 2021 at 13:45 UTC ( [id://11136991]=note: print w/replies, xml ) | Need Help?? |
4887.15 cannot be stored accurately as a floating-point number, which is causing your issue. Could it be that (at least part of) the problem is that the OP is expecting that sprint("%d", 488714.999) will return the string 488715 ? It won't:
Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|