| 
	
 | 
 Posted by Jasper Bryant-Greene on 07/03/05 03:02 
Satyam wrote: 
> I would rather use native data types and functions.  This is a good idea  
> when you have to deal with the balance sheet of a corporation, where you  
> have to handle huge numbers and still be precise up to the last cent.  For  
> most retail business, where the largest amount can still be expressed in  
> cents within the range of a 32 bit integer, the bcmath package is like  
> overkill. 
 
Please don't top-post. You make a fair point though. Have you looked at  
the "precision" configuration directive [1]? 
 
In my applications I just let PHP store as many significant digits as it  
likes during processing, and use number_format() whenever displaying to  
limit it to 2 decimal places. That, coupled with storing them as  
decimals with 2 decimal places in my MySQL databases, achieves  
everything I need. 
 
Jasper
 
  
Navigation:
[Reply to this message] 
 |