You are here: Re: [PHP] [OFF: logical question] rounding in steps of 15 « PHP « IT news, forums, messages
Re: [PHP] [OFF: logical question] rounding in steps of 15

Posted by "Richard Lynch" on 08/18/05 11:47

On Thu, August 18, 2005 12:56 am, Norbert Wenzel wrote:
> 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.

You're on your own converting 1:38 or 357 into minutes, but:

$minutes = 357;
$minutes = 15 * round($minutes / 15);
echo "minutes: $minutes\n";

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this 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

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