-
Decimal
How do you tell php to print only up to 2 decimal places
From 4.66666666667
to 4.66 Or 4.67 depending on how it works?
-
Easy
PHP Code:
echo round(4.66666666667, 2); //Shows 4.67
For more info:
http://php.net/round
-
thanks
oh and what is the main difference of
print and echo??
because someitmes i see print, sometimes i see echo. Is there a better one or what?
-
For that, I'll redirect you here:
http://www.google.nl/search?q=echo%2...%2C+difference
Check out the first 2 hits, they have enough info about your question.
-
-
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks