Re: A math puzzler for you
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: A math puzzler for you

From: Geoff Berrow <blthecat@ckdog.co.uk>
Date: Fri Apr 07 2006 - 23:45:59 CEST

Message-ID: <1144438457.389536.252430@i40g2000cwc.googlegroups.com> from
monomaniac21 contained the following:

>I have a php code that generates numbers. sometimes is generates whole
>numbers but most of the time decimals. How can I, when it generates a
>whole number, convert the number to n.0
>where n is the whole number?

$var=23;

print number_format($var,1);

//outputs 23.0

-- 
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Received on Mon May 1 02:51:02 2006