/ Published in: PHP

I needed to split a decimal number into the integer part and the fraction part and save both of them in different variables
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function split_number ( $number ) { //Convert any entered number into a float //Get the integer part //Get the fraction part $fraction = $number - $intpart; }
Comments
