Home  |  About  | Last |  Submit  |  Contact
AllQuests.com




Previous Question:  Super Mario Kart  General ChatNext Question:  Newbie MySQL PHP insert question  PHP
Question whole numbers ( SitePoint Forums PHP )
Updated: 2008-11-23 03:25:02 (3)
whole numbers

Hi Guys

How can I have the result of a calculation to remove a decimals and
just give me a whole number.

eg 10/3 = 3.3333333333333

but I would like the answer to be 3 or even 4

Thanks
Niva

Answers: whole numbers ( SitePoint Forums PHP )
whole numbers

use ceil() or floor().

mPeror

whole numbers

intval(), round($number,0), number_format($number,0)...

cflorinel

whole numbers

...0^$number, 0|$number, printf("%d",$number)... who's next?

stereofrog

Previous Question:  Super Mario Kart  SitePoint Forums  General ChatNext Question:  Newbie MySQL PHP insert question  SitePoint Forums  PHP

- Source: whole numbers SitePoint Forums PHP
- Previous Question: Super Mario Kart SitePoint Forums General Chat
- Next Question: Newbie MySQL PHP insert question SitePoint Forums PHP