Separator decimal

17 Mar '14, 07:09 PM
2,049 Views
Forum Forum Expert - Level 5

How to get the separator of decimal for localization in the layaout?

 

thanks.

 
x 0
Follow
Answer Answer at this question and get points!
Forum Starter - Level 2

Probably something like:

 

<script type="text/javascript">
     messages = {<% { java.util.Locale locale = (java.util.Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY);
     java.text.DecimalFormatSymbols df = new java.text.DecimalFormatSymbols(locale); %>
     "locale":"<%=locale.getLanguage()%>",
     "decsep":"<%=df.getDecimalSeparator()%>",
     "groupsep":"<%=df.getGroupingSeparator()%>",
     "decimals":"<%=java.text.NumberFormat.getNumberInstance(locale).getMaximumFractionDigits()%>"}

</script>

   
x 1
Forum Starter - Level 2

forgot to put <% } %> before closing script tag. (Can't find post edit button?).

 
x 1
Answer at this question and get points!