dbmathis has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
The following code:
my $result = 4.25 / 1200;
Yields:
0
How do I make $result contain:
0.0035417
I tried:
$result = sprintf "0.7f", 4.25 / 1200;
That didn't work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dividing and result of zero.
by ikegami (Patriarch) on Jan 05, 2009 at 00:57 UTC | |
|
Re: Dividing and result of zero.
by ysth (Canon) on Jan 05, 2009 at 01:13 UTC |