Hi
I need to be able to seperate a decimal into two parts - the numbers before the decimal and those after and store them in 2 variables with no rounding taking place...
for example:
for the number 45.25
$a = 45
$b = 25
Can someone point me in the right direction please
Thanks
Ian
manipulating decimals
Moderator: General Moderators
Re: manipulating decimals
Code: Select all
$number = 46.25;
$a = floor($number);
$b = $number - $a;