Re: Question about dopping zeros

From: Date: Thu, 25 Jan 2001 23:15:07 +0000
Subject: Re: Question about dopping zeros
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-36723@lists.php.net to get a copy of this message
Oops! Copied the numbers wrong. Here's are the numbers I meant to type: R> $onum output R> 4.166 4.12 4.1166 4.12 R> 4.135 4.11 4.1135 4.11 R> 4.000 4 R> 4.3000 4.3 R> Is that what you wanted? To me, it's much easier to code and use R> than reg expressions and replaces. R> Best regards, R> Randy R> Thursday, January 25, 2001, 1:10:18 PM, you wrote: EN>> I need to format decimals that are percise to the second place in the EN>> following format: EN>> 4.00 to 4 EN>> 4.50 to 4.5 EN>> 4.25 to 4.25 EN>> As you can see, I just want to drop the trailing zeros, and if necessary the EN>> decimal. EN>> Thanks EN>> ___________________________________ EN>> Ethan Nelson, Systems Administrator EN>> Net Solutions, LLC EN>> 840 Lawrence Street EN>> Eugene, OR 97401 EN>> enelson@netsolutionsllc.com EN>> http://www.netsolutionsllc.com EN>> Voice +1 541 345-7087 EN>> Fax +1 541 485-5519

« previous php.general (#36723) next »