I am trying to format prices using DecimalFormat, but this isn\'t working for all variations.
DecimalFormat df = new DecimalFormat(\"0.##\") df.format(7.8) d
Use the BigDecimal number class instead:
e.g. if n is a BigDecimal, then you can use
String s = NumberFormat.getCurrencyInstance().format(n);
By the way, it's best practice to use BigDecimal when working with money.