I need store in MySQL all prices submitted by users. The prices submitted by the users can contain these formats:
123.456,78 (ARG format)
123,456.78 (US format)
123456,78 (ARG simplified format)
123456.78 (US simplified format)
In MySQL i have a column named "price" of type decimal
.
My question is, How can i convert those formats to decimal
to save them in my database?, or, How can i convert values to "ARG simplified format" to save all as varchar
? I need all with the same format (two decimals).