Hi,

I don't know if this is the right mailing list for this question.
Let me know if I should go somewhere else.

The issue is a number rounding problem.

Here is my perl snippet:


$credit = "64.63";
$amount = $credit * 1000;

printf "credit %s,  amount %12.12d\n", $credit, $amount;

$amount = $amount / 10;

printf "credit %s,  amount %12.12d\n", $credit, $amount;



What starts out as 64.63  ends up being 00000006462

That's bad.  Any ideas on how to fix, work around etc?

I've reproduced this on my main server (HP-UX,
Perl 5.08.05) and on another machine  (Red Hat Enterprise
Linux also Perl 5.08.05)

Thanks!



--
Chris Howard              
CIS Database Administrator   Platte River Power Authority
[EMAIL PROTECTED]                           (970) 229-5248 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to