in reply to Re: sprintf and decimals
in thread sprintf and decimals
2.315 rounded is 2.31#!/usr/bin/perl $w=2.315; $x=2.3150141; $y=sprintf("%.2f", $w); $z=sprintf("%.2f", $x); print "$w rounded is $y\n"; print "$x rounded is $z\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: sprintf and decimals
by ikegami (Patriarch) on Nov 15, 2006 at 18:55 UTC |