Johannes
 
Thanks for clearing this up - makes sense now.
 
Derek
 
PS I am glad I am not the only one to struggle with the 
Java DecimalFormat docs - for example, how can they say:
 
"However, care must be taken that the symbols and strings 
do not conflict, or parsing will be unreliable."
 
Why not just specify what "symbols and strings" will work, or
will not work, so there is not any ambiguity.  A bit like saying:
"be careful when you name variables as some combinations
of letter/numbers/symbols may not work"...

Derek Hohls
Systems Developer
Natural Resources and the Environment
CSIR
PO Box 17001
Kwa-Zulu Natal
South Africa
4013
www.csir.co.za


>>> "Johannes Textor" <[EMAIL PROTECTED]> 2007/05/25 10:53 AM >>>

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



-- 
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
 
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
[EMAIL PROTECTED]


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to