int i=1, j=3;
(i/j == 0) not 0.3333etc.
Try "float" for totalUnits and units[].

Dilenger4,
I think he's calling the inherited method
public final String format(double number)
from java.text.NumberFormat
and I just noticed that you metioned integer versus floating point division.