Fixed Decimals

Fixed Decimals project page

A FixedDecimal is similar to a ScaledDecimal, but different in certain select ways. It's primary purpose was to be able to represent precise decimals for such things as representing money - where ScaledDecimals leave something to be desired. For instance, with ScaledDecimals, you get:
(33.333s withScale:2) + (33.333s withScale:2) print it yields 66.67s
but with FixedDecimals, you would get:
(33.333 asFixedDecimal: 2) + (33.333 asFixedDecimal: 2) print it yields 66.66.
So, FixedDecimals round the numbers to the exact scale you specify - converting a float (or fraction) to a FixedDecimal and back will not necessarily return the starting number, unlike ScaledDecimals.

FixedDecimal-cbc.26.mcz
FixedDecimal Tests-cbc.3.mcz
FixedDecimal-WernerGerbert.1.mcz
FixedDecimal-cbc.25.mcz
FixedDecimal Tests-TorstenBergmann.3.mcz
FixedDecimal-cbc.20.mcz
FixedDecimal-kph.17.mcz
FixedDecimal-kph.16.mcz
FixedDecimal-kph.15.mcz
FixedDecimal-kph.14.mcz
FixedDecimal Tests-cbc.2.mcz
FixedDecimal-cbc.13.mcz
FixedDecimal Tests-cbc.1.mcz
FixedDecimal-cbc.12.mcz