Kind regards,
Robin MEEUWSEN
>How do I insert an amount using a comma for the decimals when the
>database only accepts dots for decimals?
What database? What scripting language? Why not simply replace the comma
before inserting the value?
Micha
Kind regards,
Robin MEEUWSEN
Simply replace the comma before inserting the value. u can use the
str_replace().
<?
$number="153,73";
echo str_replace(",","",$number);
//OUTPUT: 15373
?>
>MySQL, PHP. I have a form to input an invoice. MySQL only accepts dots. The is
>going to be made using a comma so the centimes are not inserted. 153,76 will
>become 153.00
Then replace the comma before inserting the value.
http://www.php.net/strtr
http://www.php.net/number_format
Micha
wrap $_POST['form_value'] with:
str_replace(",",".",$_POST['form_value'])
--
Gareth
http://www.phploginsuite.co.uk/
PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.