Results 1 to 3 of 3
I want to do some integer in round figure
Ex. 99.777777777777777777777 to 100
99.444444444444 to 99
but I am using perl old version so can't use
use Number::Format;
and I ...
- 02-08-2008 #1Linux Newbie
- Join Date
- Jan 2008
- Posts
- 114
How to do round figure 99.777777777777777777777 to 100 in perl
I want to do some integer in round figure
Ex. 99.777777777777777777777 to 100
99.444444444444 to 99
but I am using perl old version so can't use
use Number::Format;
and I can't install latest version of perl on server, not in my control.
Please help me.
Thanks-
- 02-08-2008 #2Hope this helps.Code:
$xxx=int($xxx+0.5);
--
Bill
Old age and treachery will overcome youth and skill.
- 02-11-2008 #3Linux Newbie
- Join Date
- Jan 2008
- Posts
- 114
Thanks, it works!!!


Reply With Quote