![]() |
|
#1
|
|||
|
|||
problem with rounding the float numbersI have got problem with rounding the floating number when using round() function as well as numberformat
for eg:number_format( 424.025, 2, '.', ',' ) = 4.02 where it should be 424.03 also round(424.025,2) giving the same answer ie 4.02 what to do solve this problem.please help |
|||
|
#2
|
||||
|
||||
|
Hello rose,
The question I'd really like to ask here is whether you require this "result" just for display purposes (on a web page)? If yes, then you may try using a custom function like the example in the PHP code below... PHP Code:
results in: $ttl_after_round is 424.02 $ttl_for_display is 424.03 Please note that I am just suggesting this as a possible fix for your specific problem... I had to think this up just now, so I may not have thought this through enough. Your comments are definitely appreciated. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
|
The function was very usefull.I implemented it and got the desired result.
thankyou verymuch, rose |
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help with my programs, please help. | agentxx04 | C Programming Language | 1 | 23-Sep-2004 19:02 |
| Please Help, problems writing c program REVISED | soulfly | C Programming Language | 6 | 03-Mar-2004 14:57 |
| Code problem (a newbie question) | monkster87 | C++ Forum | 3 | 11-Aug-2003 13:46 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The