0

Hi,

i wrote some command for division of numbers by certain number for example 1000000

and

$filesize=$size/1000000;

the result shown some things like this 12.24927

but i need just the first part of this number for example i want to write 12 instead of this 12.24927 . how can i eliminate the second part ?

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by cereal
1

Use floor() or ceil(), floor will output 12 no matter if it is 12,2 or 12,9, ceil is different, since 12,51 will output 13 instead of 12.

$filesize=floor($size/1000000);

Edited by cereal: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.