The helper class DecimalFomatSymbols is what you are looking for:
DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance();
DecimalFormatSymbols symbols = format.getDecimalFormatSymbols();
char sep=symbols.getDecimalSeparator();
To set you symbols as needed:
//create a new instance
DecimalFormatSymbols custom=new DecimalFormatSymbols();
custom.setDecimalSeparator(',');
format.setDecimalFormatSymbols(custom);
EDIT: this answer is only valid for DecimalFormat
, and not for NumberFormat
as required in the question. Anyway, as it may help the author, I'll let it here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…