fork(4) download
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;

class Ideone {
    public static NumberFormat seuFormato() {
        DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.ROOT);
        symbols.setDecimalSeparator(',');
        symbols.setGroupingSeparator('.');
        return new DecimalFormat("#0.00", symbols);
    }

    public static void main(String[] args) {
        NumberFormat formatter = seuFormato();
        float a = 5;
        System.out.println(formatter.format(a));
    }
}
Success #stdin #stdout 0.12s 321152KB
stdin
Standard input is empty
stdout
5,00