Hacker News new | ask | show | jobs
Mapping BigDecimals with Morphia for MongoDB (technology-ebay.de)
1 points by pahund 4636 days ago
It's generally better to use BigDecimals for storing prices, because floats and doubles do not store exact values. Unfortunately, if you use Morphia as an abstraction layer for MongoDB, BigDecimals are not supported. To overcome this issue, you can convert those BigDecimals to exact data types, such as long values. This article explains how it's done.