Hi Joerg, Derek,

quoting Joergs sample code:

DecimalFormat decimalFormat = 
(DecimalFormat)NumberFormat.getNumberInstance(locale);
decimalFormat.applyPattern("### ### ###.###");

decimalFormat.format(value);

Guessing from the Java DecimalFormat docs (which are REALLY confusing BTW), 
this should not work, as " " may only be part of a prefix or postfix. Rather, 
it should be something like 


 DecimalFormat decimalFormat = 
 (DecimalFormat)NumberFormat.getNumberInstance(locale);
 decimalFormat.applyPattern("###,###");
decimalFormat.setGroupingSeparator(" ");
 
 decimalFormat.format(value);

My point in the last post was that the current convertor does not make it 
possible to set the GroupingSeparator explicitly, but rather infers it from the 
locale. I think Derek is right in that this should be a standard capability. 

Following the current logic of the fd:converter tag, maybe there should be 
attributes "grouping-separator" and "decimal-separator" on the fd:converter tag 
which can be used along with variant="number" and variant="integer" to provide 
full access to the DecimalFormat capabilities. If you agree with that, I might 
create a patch this afternoon to enable this. (Need it myself, too). 

Cheers,
Johannes


Reply via email to