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

[241 byte] By [PieterPareita] at [2007-11-27 11:48:34]
# 1

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.

BalusCa at 2007-7-29 18:20:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

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...

hetal_giria at 2007-7-29 18:20:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

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

PieterPareita at 2007-7-29 18:20:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

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)

evnafetsa at 2007-7-29 18:20:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...