CNumberFormatter formatting of the numbers

Here: http://www.yiiframework.com/doc/api/1.1/CNumberFormatter they say that having a number like :

12345.678 and using the “#,##0.00” pattern will result in 12,345.68 but how about if i need to convert 12,345.68 for mysql decimal data type(12345.68) ? how should i proceed ? (don’t tell me str_replace the comma with nothing)

I am asking this because, i have a products table having a price field [ decimal(15,4) ] and i need to format the price when the user edits the product so that the price is shown in his current locale (us/european) but also, when saving into mysql, i need to save the price in the correct format, doesn’t matter what kind of format the user enters, the script should be smart enough to translate the format user entered in the one mysql required.

So how can i do this ?

Really, nothing ?