Dec 15, 2000 #1 tonyjob Programmer Nov 20, 2000 25 GB how can you round a number up? so if the numbers 8.09181 it will round up to 9?
Dec 15, 2000 #2 goBoating Programmer Feb 8, 2000 1,606 US one guess..... Code: #!/usr/local/bin/perl $num = '8.0134'; if ($num - int($num)) { $num = int(++$num); } print "$num\n"; 'hope this helps. keep the rudder amid ship and beware the odd typo Upvote 0 Downvote
one guess..... Code: #!/usr/local/bin/perl $num = '8.0134'; if ($num - int($num)) { $num = int(++$num); } print "$num\n"; 'hope this helps. keep the rudder amid ship and beware the odd typo
Dec 15, 2000 #3 tanderso IS-IT--Management Aug 9, 2000 981 US you could use sprintf() or POSIX::ceil or you could do int($num+1) Sincerely, Tom Anderson CEO, Order amid Chaos, Inc. http://www.oac-design.com Upvote 0 Downvote
you could use sprintf() or POSIX::ceil or you could do int($num+1) Sincerely, Tom Anderson CEO, Order amid Chaos, Inc. http://www.oac-design.com
Dec 15, 2000 Thread starter #4 tonyjob Programmer Nov 20, 2000 25 GB thanks for your help, i used a different technique. i added 0.9999999 to the number and then cut the decimals off. Upvote 0 Downvote
thanks for your help, i used a different technique. i added 0.9999999 to the number and then cut the decimals off.
Dec 15, 2000 #5 tanderso IS-IT--Management Aug 9, 2000 981 US That is exactly what I said above: int($num+1) Sincerely, Tom Anderson CEO, Order amid Chaos, Inc. http://www.oac-design.com Upvote 0 Downvote
That is exactly what I said above: int($num+1) Sincerely, Tom Anderson CEO, Order amid Chaos, Inc. http://www.oac-design.com