Subject | decimal separator |
---|---|
Author | Sergio H. Gonzalez |
Post date | 2008-08-25T21:56:42Z |
Hi !
I generate some inserts with my Delphi app. I'm experimenting some problems if
the PC which is running the program has , (comma) as decimal separator.
Having a field "amount" numeric (18,3) an a value of $100.23
My insert would be like:
INSERT INTO MYTABLE (amount) VALUES 100,23
I tried with
INSERT INTO MYTABLE (amount) VALUES '100,23'
and
INSERT INTO MYTABLE (amount) VALUES cast ( '100,23' as numeric (18,3))
and both inserts give me an "overflow" exeption.
I'd like to know is the common practice to deal with it. I could reeplace the
"," for a "." in my app. But is that the *correct* way to do it?
thanks!
-sergio
I generate some inserts with my Delphi app. I'm experimenting some problems if
the PC which is running the program has , (comma) as decimal separator.
Having a field "amount" numeric (18,3) an a value of $100.23
My insert would be like:
INSERT INTO MYTABLE (amount) VALUES 100,23
I tried with
INSERT INTO MYTABLE (amount) VALUES '100,23'
and
INSERT INTO MYTABLE (amount) VALUES cast ( '100,23' as numeric (18,3))
and both inserts give me an "overflow" exeption.
I'd like to know is the common practice to deal with it. I could reeplace the
"," for a "." in my app. But is that the *correct* way to do it?
thanks!
-sergio