![]() |
|
#1
|
|||
|
|||
decrease decimal in phpi have a simple calculation script using PHP, and it produce very long floating point. ex;
$Eng_rate6=($rate6/$english)*100; then, var $Eng_rate6 will be 33.3333336. how can i decrease it point so that it will be 33.33? |
|
#2
|
|||
|
|||
Re: decrease decimal in php<?php
$val = 33.3333336; $val = (float) sprintf("%1.2f", $val); echo $val; ?> |
|
#3
|
|||
|
|||
Re: decrease decimal in phpyeah! it work! tq so much friend........
|
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Roman to decimal to roman | SpudNuts | CPP / C++ Forum | 2 | 16-Feb-2005 19:44 |
| Help ! I need help starting up on Php ! | onauc | MySQL / PHP Forum | 11 | 04-Jan-2005 23:57 |
| Hex Result giving strange answers. | Rosdahale | C Programming Language | 6 | 07-Dec-2004 20:28 |
| uisng php to display php | dopee | MySQL / PHP Forum | 6 | 14-May-2004 18:40 |
| All the big PHP script collections that matter | jrobbio | MySQL / PHP Forum | 5 | 06-Jun-2003 16:14 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The