i have a php function here echo $balance['credit'];
which outputs numbers like this 34.60000
I dont want it to have the 3 extra 0's so how do i strip the last 3 ?
I tried using this here but didnt work. strip characters
i have a php function here echo $balance['credit'];
which outputs numbers like this 34.60000
I dont want it to have the 3 extra 0's so how do i strip the last 3 ?
I tried using this here but didnt work. strip characters
Use printf to do formatted printing. E.g., echo sprintf('%.2f', $balance['credit']);