http://qs321.pair.com?node_id=11136991


in reply to Re^3: Padding with sprintf changing number
in thread Padding with sprintf changing number

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:
C:\>perl -le "print sprintf('%d', 488714.999);" 488714

Cheers,
Rob