Jump to content

testing part numbers


wright67uk

Recommended Posts

How can I test a number for digits after a decimal point?

 

I would like to do somthing like;

 

$num = 5.34

If the digits after the decimal point of $num are less than .10 then round down, else

$num++

 

The idea being that this could be used in a loop until either a whole number is found, or until a number is rounded down.

Link to comment
https://forums.phpfreaks.com/topic/275217-testing-part-numbers/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.