Altering data type from FLOAT to DECIMAL. Unforseen issues?

66 Views Asked by At

An established database is storing currency values in FLOAT types. This is causing accuracy (or lack thereof) problems.

Is it safe to convert these cols containing (all numeric) values over to DECIMAL without any issues? Typical values are 0 - 999,999.99

Yours makingchangeslateinthedaybeforedinnerisdangerouswithoutthinkingtwice-ingly,

1

There are 1 best solutions below

0
On BEST ANSWER

Just set your precision high enough when declaring the DECIMAL so that you save all the significant digits you care about.

http://dev.mysql.com/doc/refman/5.0/en/fixed-point-types.html