Reply to [OFF: logical question] rounding in steps of 15

Your name:

Reply:


Posted by Norbert Wenzel on 08/18/05 10:56

Excuse me, I know my question is not PHP specific, but I hope there are
some logical and mathematical talents in here, since I've always been
fighting with maths. ;-)

I have to provide a textfield, where workers enter their time they
worked on a certain subject. The smallest degree should be 15 minutes,
but the workers may enter every time, such as 357 or maybe 1:38.

Is there any better way to determine the next 15min step, than to take
for example 38 % 15 = 8 and see whether the result is nearer to 0 or to
15? In this case (8) 8 + 8 would be 16 so i would save 45 minutes of work.

These are just informations for calculation of upcoming projects, so I
don't have to check any legal rules for rounding work time or something
like this.

I think my way is quite complicated, so I hope anyone of you knows a
better possibility to round to a certain degree.


Thanks in advance,
Norbert

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация