Hello, i have this issue with the leading zero, i tryed several ways with the same wrong result, what i am trying to do is to keep a leading zero when the amount is for example 0,4 because when i run the program it prints me ,4 can you help me please.
This is the code that i have:
[code=
public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
// TODO Auto-generated method stub
arg2=arg2.replace(',', '.');
return new java.lang.Double(arg2);
}
java]public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) {
double monto = (Double)arg2;
NumberFormat formatter = new DecimalFormat("###,###,###.00");
return nf.format(monto);
}[/code]
But when the amont is for example 0,4 it prints ,4 is there any way to print the result with the leading zero?