Hi Tom,
Try this:
$years = round($years + ( $themonth / 12 ));

 From the manual:
float round ( float val [, int precision])
Returns the rounded value of val to specified precision (number of digits 
after the decimal point). precision can also be negative or zero (default).


ceil() and floor() also exist.



Peter


At 03:46 PM 9/23/2002 +0100, Tom wrote:
>Hi all,
>
>I have a line of code that assigns a new year number: -
>
>$years = $years + ( $themonth / 12 );
>
>but sometimes $years == 1998.0833333333
>
>or
>
>$year == 2002.75
>
>etc...
>
>I cant find anything like a round() or floor() function in PHP so that year
>would be 1998 or 2002 only.
>
>Does anyone know what function would do this?  Sorry if I`m wasting your
>time if its a really obvious one!
>
>thanks in advance,
>Tom
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -

Reply via email to