* Asbjørn Konstad
> I’ve spent some day(s) probing the web to find a solution to this problem:
>
> A table-column for storing currency –> float(10,2).
>
> As my users are punches the currency value like this “255,55”,
> with a comma as decimal point, MySQL stores this value as zero (0.00).
>
> I quess the reason for this is that MySQL uses “.” as decimal point for
> float-types (or any decimal value).

jupp.

> Does anyone know of a workaround for this problem??. Is there any way of
> changing the decimal separator in MySQL??

You can't change the decimal separator in mysql, you must change it in your
application. You need to check/verify the input from your users before you
put it in the database.  You probably use some programming language to
handle the user input? Verify that the input actually is numeric, that it
contains only one decimal separator (, or .), it's not too big or too small
and so on. If the 'wrong' decimal separator is used, change it to the
correct (".") _before_ you send the value to mysql, but without notifying
the user. That way both "255,55" and "255.55" can be entered. If, for
instance, your numbers was allways in the range 0-1000 and allways should
have two decimals, you could also accept "25555" and "255 55", and put in
the "." in your code. You could accept ",-" (used to represent zero øre in
norwegian prices.) and convert it to ".00".

--
Roger


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to