Re: [PHP] Question about dopping zeros

2001-01-25 Thread Randy
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.30004.3 R> Is that what you wanted? To me, it's much easier to code and use R> than reg expressions an

Re: [PHP] Question about dopping zeros

2001-01-25 Thread Randy
Hello Ethan, $onum=4.11440; $onum =number_format($onum,2)+0; echo $onum; With this technique, you get the following: $onum output 4.166 4.12 4.135 4.11 4.000 4 4.30004.3 Is that what you wanted? To me, it's much easier to code and use than reg expressions and replaces. Bes