|
|
| Just another Perl shrine | |
| PerlMonks |
Answer: How do I round a number? |
| ( #161255=categorized answer: print w/ replies, xml ) | Need Help?? |
|
Q&A > math > How do I round a number? contributed by powerman
Here shown all round-like functions which exists in perl:
This code produce this output: number int printf floor ceil 3.30 3.0 3.3 3.00 4.00 3.50 3.0 3.5 3.00 4.00 3.70 3.0 3.7 3.00 4.00 -3.30 -3.0 -3.3 -4.00 -3.00 -3.50 -3.0 -3.5 -4.00 -3.00 -3.70 -3.0 -3.7 -4.00 -3.00 3.45 3.0 3.5 3.00 4.00
|
|
||||||||||||||||||