Question
Replace comma with dot
I have an update form to update an amount. The amount is
stored in a database as a decimal 10,2. When I request the update
form I get the amount as 1000,00 due to the fromatting I'm using.
When I alter the amount in 1000,55 and send the input then
everything before the comma gets updated and all that comes after
is gone. If I type a dot instead of the comma then the amount is
updated correctly. How can I do the update statement so that the
comma gets replaced by a dot?
Update statement:
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "frmBudget")) {
$updateSQL = sprintf("UPDATE tbl_budgets SET budget=%s WHERE schoolid=%s",
GetSQLValueString($_POST['budget'], "double"),
GetSQLValueString($_POST['schoolid'], "int"));
Thanks in advance!
Robin
Update statement:
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "frmBudget")) {
$updateSQL = sprintf("UPDATE tbl_budgets SET budget=%s WHERE schoolid=%s",
GetSQLValueString($_POST['budget'], "double"),
GetSQLValueString($_POST['schoolid'], "int"));
Thanks in advance!
Robin
