I guess floats are not ideal for currency. Mongoid supports Float and BigInteger. What’s the best approach for storing and working with currency values?
I guess floats are not ideal for currency. Mongoid supports Float and BigInteger. What’s
Share
You might probably want to have a look at the Money gem.
The way it works, is to represent money amounts in cents and use integers.
You can follow this way and store your data as integer so that you don’t need to deal with Float precision.