Candidates are :
- 2 ints (one indicating scale),
- float (used with caution when doing calculations as this type is inherently imprecise and in some cases imprecision errors can wrongfully add up),
- BigDecimal (since it seems to be the standard in java for that type of things)
The problem with option number one is i am lazy and don't want to reinvent wheel if someone has already done it better than me.
The problem with option number two and three are : are those not overkills, and wouldn't those severely impact performance as well as memory and storage usage when those "10 or 20 bytes and little performance overhead" are multiplied by millions of stock quotes, additions, differences, and comparisons.