I understand that using Double data type for Money calculations is asking for trouble so Decimal should be used instead.
I feel stupid asking this, but could there be potential problems in using the Double data type to just store or transport a Money value, so long as it is converted to a Decimal when doing calculations?
I ask this because I have an old application on my hands to maintain, and it is using Double everywhere. To save work, I would like to only refactor the parts that actually do calculations, to use Decimal instead of Double. I would like to leave the rest of it alone where it is only plumbing code for data-transfer, serialization and such.
There is a loss of precision when you store data in
doublenot just when you retrieve it. So no, this doesn’t get around your problem. You can’t magically retrieve precision that has been lost.