Re: Another silly email

From: Date: Sat, 27 Apr 2002 08:06:55 +0000
Subject: Re: Another silly email
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-94872@lists.php.net to get a copy of this message
On Sat, 27 Apr 2002, baldey_uk wrote: > Um im trying to take the input from a txt field in an html form (which > happens to be a number) and convert it to currency. Anyone know if there is > a function in PHP to do this or do i have to convert to a float etc? What do you mean by a currency? If you mean a number with two decimal places, you can do something like: $currency_val = sprintf('%.2f', floatval($_REQUEST['how_much_money'])); miguel

« previous php.general (#94872) next »