I need a financial type that will always contain numbers in the format X ... X.YY, even 20 digits, so I will get rid of rounding, formatting and other headaches. There is one?
Added: In other words, I'm looking for something like:
Financial f = 1000.24;
f.setCurrency (USA);
System.out.print (f.toString ()); → $ 1'000.24
You can always keep financial data in debt, expressed in pennies. But, as you say, various headaches are involved in this, and the maximum value, I think, is 19 digits. So BigDecimal seems to be the way to go.
(, BitInteger/BigDecimal, , , .)
Java.
BigInteger ( ), , . ( ). , BigInteger , .