elixirmoney/money

Add a decimal precision money type

Closed this issue · 0 comments

sitch commented

There are times when things like averages would be stored in the database with a precision > 2.

Would be useful to have a decimal precision money type for this in ecto. obviously its a bit more complicated when doing multiplications / divs

Another thought is having an algebraic numerator / demoninator factor list for so you have things like:

x = 1000
y = 66
z = x / y # this would be 15.151515...

But it could be stored as:

z = [[1000], [66]]

or

z = [[2, 500], [2, 33]]

and reduced as

z = [[500], [33]]