LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author] [stats]
  From: Andrew Hill <list@fornax.net>
  To  : Andrew Reid <andrew.reid@plug.cx>
  Date: Mon, 12 Feb 2001 11:08:41 +1030

Re: PHP Question...

Andrew Reid wrote:
> 47.1231231123
> This is obviously 47.12MB. What I want to do is to trim the string down
> to get only the last two decimal places.
> Any suggestions or tips would be greatly appreciated.

PHP also has a printf() function, and sprintf() which returns the string
in the format desired. Or, you could use the substr() feature. Depends
on how you feel about that sort of thing :-)

Cheers,

-- 
Andrew Hill

"Right now, I'd happily snort gunk from the sink if it would take
my brain somewhere away from here...." - JB

-- 
LinuxSA WWW: http://www.linuxsa.org.au/  IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
  mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject


Index: [thread] [date] [subject] [author] [stats]
Return to the LinuxSA Mailing List Information Page