File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Servlet&JSP: Decimal pointer problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet&JSP: Decimal pointer problem" Watch "Servlet&JSP: Decimal pointer problem" New topic

Servlet&JSP: Decimal pointer problem

nan sh
Ranch Hand

Joined: Jan 05, 2001
Posts: 167
I try to build a web site, using servlet&JSP( The decimal pointer of goods price is comma ",", I guess is hosted in France. The problem is that from visitor in here(Australia, or US), a decimal pointer is period ".", I have got no idea to how to build a dynamic page which is smart enough to decide which decimal pointer should be used, according to where visitors from.
Do you have any idea?

Have you tried this Mock Exam Testing Engine yet?<br /><a href="" target="_blank" rel="nofollow"></a>
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
From our international menu.
One spoonful of ServletRequest.getLocale().
A generous portion of java.text.NumberFormat.getInstance(Locale).
Plenty of ResourceBundle.
Take the ServletRequest.getLocale() and stir into the NumberFormat.getInstance(). Then format() the resultant object well. Stir in the contents of the java.util.ResourceBundle according to taste and serve hot.
- Peter (purveyor of fine internationalised cuisine)
nan sh
Ranch Hand

Joined: Jan 05, 2001
Posts: 167
Thank you Peter
I am going to try that.
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 567
is it still true that many browsers out there don't send an ACCEPT-LANGUAGES header with their HTTP?

I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
I agree. Here's the link:
subject: Servlet&JSP: Decimal pointer problem
jQuery in Action, 3rd edition