Tim Moores wrote:Given that money generally has at most two decimal places, you might as well make myMoney a float rather than a double.
The number of places after the decimal point is not relevant. For example, the value 17878654.45 has 10 significant figures and cannot be stored in a float without loss of precision.
Money is often represented as a long, specifying the number of cents. 1787865445 easily fits in a long.