Default number formatting Tomcat
Hi,
Is there somewhere a property in tomcat where I can specify a default number format.
I want to display my decimals with a comma in order than a point
123.45 should be 123,45
Thanks in advance,
Pieter
Hi,
Is there somewhere a property in tomcat where I can specify a default number format.
I want to display my decimals with a comma in order than a point
123.45 should be 123,45
Thanks in advance,
Pieter
NumberFormat uses the locale of the operating system where the server runs.
If the locale is set to US for example, you'll get the dot as decimal separator.
Set the locale to your country (Belgium, I guess?), then it should use the comma as decimal separator.
i dont know abt tomcat...
ya but the is number formatting class in java..
check out this link
http://www.exampledepot.com/egs/java.text/FormatNum.html
n you can use this is jsp...
Hi,
My locale is set to Dutch(Belgium), decimal symbol is a comma.
I don't want to format my numbers manually because this is a hell of a job.
So I'm still searching...
Pieter
Best solution is to use the JSTL tag <fmt:formatNumber> to do all the number formatting for you at the presentation layer of the JSP.
Based on the selected locale, it will apply the correct formatting (it uses the java.text.NumberFormat class mentioned before)