Re: Floating numbers truncating to two digits without rounding

From: Date: Mon, 09 Jan 2006 22:27:23 +0000
Subject: Re: Floating numbers truncating to two digits without rounding
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-228372@lists.php.net to get a copy of this message
On Monday 09 January 2006 03:20 pm, Mark Steudel wrote: > I am calculating things like tax and want to format them so they only have > 2 digits past the decimal point. I've been using sprintf but just noticed > that it tends to round up. I want the same functionlity without rounding. > > Thanks You could try number_format() though I haven't looked to see if it rounds up or not. -- Ray Hauge Programmer/Systems Administrator American Student Loan Services http://www.americanstudentloan.com

« previous php.general (#228372) next »