![]() |
roundup to 60 or 70 or 50
This is probably an easy question but i'm in it so deep that i totally
do not see the answer. I get the number 61; I need to know the nearest decimal up. So I need to know 70. how do I do that? I'm totally stuck. |
Re: roundup to 60 or 70 or 50
Antoine Adams wrote:
> I get the number 61; > I need to know the nearest decimal up. So I need to know 70. $roundup = $num % 10 ? $num - $num % 10 + 10 : $num; -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl |
Re: roundup to 60 or 70 or 50
>>>>> "Antoine" == Antoine Adams <antoine@nebula.nl> writes:
Antoine> I get the number 61; Antoine> I need to know the nearest decimal up. So I need to know 70. I usually cheat with something like 10*int(($num+9)/10), if I know they're all integers. print "Just another Perl hacker," -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! |
Re: roundup to 60 or 70 or 50 (offtopic)
> print "Just another Perl hacker,"
Ok ok.. thx guys. 3 solutions and all three work.. I liked them all and tested them all Thx thx thx thx Now I can continue playing with GD::Graph and mysql data uotput sorting :-) ---- A G-string fits better then a perl string |
| All times are GMT. The time now is 01:51 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.