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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php