On Tue, 18 Sep 2001, Wagner wrote:

> I have a variable $var and its value is 345.678975 (for example).
> How can i format $var to became 345.67.... only two digits after the
> point...

printf("%.2f", $var);

Note that this will do actual rounding of your number as well.

> Another question... my script is generating a html document and i want to
> put the following text: US$
> How can i put the $ symbol? The script interpert it as a variable and i just
> want the caracter...

Either enclose the text in single quotes 'US$', or escape the $ "US\$".

-- Brett


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to