The common practice is a decimal field with places to the right of the
Usually two places. Standard SQL has a decimal data type. There is a
reason for this.
They would not have gone to all the trouble if it were a minor point.
hardware architectures have a decimal type in addition to float and
Do you dare to test floating point numbers for equality?
While the Ruby library has a BigDecimal data type it has no “Ordinary”
decimal type. Ruby
has integers and floats. So Rails uses floats for money. This is not
the right answer.
This is the biggest hole I know of in Ruby and Rails. Ruby apparently
needs a better
regular-decimal type. I guess the BigDecimal type has problem. I’d
guess the problem is
performance. Another is formatting the output of BigDecimal numbers and
There are some good articles around somewhere that describe in detail
the reasons for the
innovation of fixed-decimal numbers and why floats are not adequate for
processing. Mostly to do with handling of rounding and the fuzziness of