aspose file tools*
The moose likes Struts and the fly likes struts2 decimal point or decimal comma Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2 decimal point or decimal comma" Watch "struts2 decimal point or decimal comma" New topic
Author

struts2 decimal point or decimal comma

debraj mallick
Ranch Hand

Joined: Mar 08, 2011
Posts: 188

hi all,

how can i get information about countries who uses decimal comma/point to mark the radix point (from action).

Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

I think we have to identify using ipaddress of the user. Take other inputs too.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
debraj mallick
Ranch Hand

Joined: Mar 08, 2011
Posts: 188

hi Mohana,

the problem with ip address is that you cannot identify the border regions between two countries, one country may have the others ip address.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Hi mallick,
one country may have the others ip address.? How this is possible can you give me one scenario?
debraj mallick
Ranch Hand

Joined: Mar 08, 2011
Posts: 188

hi Mohana,

what if the user from border region uses private IP?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18168
    
    8

Countries? Whatever your question is, that isn't the right form of the question. Try this code to see what I mean:
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

@Pual, here the problem is how to identify customer country. one case it may fail if we were identifying by ip address if end user was using proxy ip address.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18168
    
    8

Mohana Rao wrote:@Pual, here the problem is how to identify customer country. one case it may fail if we were identifying by ip address if end user was using proxy ip address.


Indeed you are. And my code asks why you are trying to solve that "problem". In case you didn't run it, it demonstrates that some parts of Canada (which you will find is a country) use decimal points and other parts use decimal commas. So why is that a "problem" worth considering at all?
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Thanks for reply Paul it's not my requirement i'm trying to help the guy who posted that question and my doubt clarified here.
http://www.coderanch.com/t/293684/JSP/java/client-IP-address-Domain-JAVA
And is it legal stealing client ipaddress?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18168
    
    8

Mohana Rao wrote:Thanks for reply Paul it's not my requirement i'm trying to help the guy who posted that question...


Notice that I didn't address you specifically when I posted that comment. Which was intended to point out that the requirement is, um, not a very good one. Which means that continuing to go on about useless things like IP addresses isn't worth anybody's time.

Actually, rereading the thread I see that you were the one who posted the idea about IP addresses. Which it now appears wasn't a very good idea because people on the same street in Canada, with the same ISP, could be using English and French. So not only does the country of the client provide the desired information, neither does the IP address of the client.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Paul, What i thought was using client ip address we can identify the country where the request is coming from so that we can enable that language format. Here i'm not worrying about what are languages are known by the end user.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts2 decimal point or decimal comma
 
Similar Threads
printf and floating point
The NumberFormat Class
Floating point number format
german comma + javascript
Problem while converting String to Bigdecimal