Hello,
I want to print a double/float value,
but i get to much numbers behind the comma.
example: 55.3333333333
I only want 2 numbers behind the comma.
Thanks
Solved: print of double/float
-
mister_v
- Posts: 203
- Joined: Thu Mar 04, 2010 9:19 pm
Solved: print of double/float
Last edited by mister_v on Wed Feb 09, 2011 8:05 pm, edited 1 time in total.
-
chris
- Site Admin
- Posts: 216
- Joined: Mon Jul 21, 2008 9:52 am
Re: print of double/float
You can do this with the function number_format()
Code: Select all
$float = 55.3333333333;
$new_num = number_format($float, 2);
echo $new_num; //55.33