Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet&JSP: Decimal pointer problem

 
nan sh
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to build a web site, using servlet&JSP(http://www.mycgiserver.com/~nan111/main.jsp). The decimal pointer of goods price is comma ",", I guess www.mycgiserver.com 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?
Thanks
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From our international menu.
Ingredients:
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
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Peter
I am going to try that.
Cheers!
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it still true that many browsers out there don't send an ACCEPT-LANGUAGES header with their HTTP?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic