Is there a way to use DecimalFormat (or some other standard formatter) to format numbers like this:
1,000,000 => 1.00M 1,234,567 =>
1,000,000 => 1.00M
1,234,567 =>
Note that if you have a BigDecimal, you can use the movePointLeft method:
BigDecimal
movePointLeft
new DecimalFormat("#.00").format(value.movePointLeft(6));