Search in sources :

Example 1 with DecimalFormatSymbols

use of com.ibm.icu.text.DecimalFormatSymbols in project head by mifos.

the class MifosNumberFormattingInfoTag method doStartTag.

@Override
public int doStartTag() throws JspException {
    try {
        Locale locale = LabelTagUtils.getInstance().getUserPreferredLocale();
        DecimalFormat decimalFormat = getDecimalFormat(locale);
        DecimalFormatSymbols symbols = decimalFormat.getDecimalFormatSymbols();
        StringBuilder sb = new StringBuilder();
        sb.append("<span id=\"format.decimalSeparator\" title=\"").append(symbols.getDecimalSeparator()).append("\"></span>\n");
        sb.append("<span id=\"format.groupingSeparator\" title=\"").append(symbols.getGroupingSeparator()).append("\"></span>\n");
        sb.append("<span id=\"format.groupingSize\" title=\"").append(decimalFormat.getGroupingSize()).append("\"></span>\n");
        pageContext.getOut().print(sb.toString());
    } catch (Exception ex) {
        throw new JspException("NumberFormattingInfoTag: " + ex.getMessage());
    }
    return SKIP_BODY;
}
Also used : Locale(java.util.Locale) JspException(javax.servlet.jsp.JspException) DecimalFormatSymbols(com.ibm.icu.text.DecimalFormatSymbols) DecimalFormat(com.ibm.icu.text.DecimalFormat) JspException(javax.servlet.jsp.JspException)

Aggregations

DecimalFormat (com.ibm.icu.text.DecimalFormat)1 DecimalFormatSymbols (com.ibm.icu.text.DecimalFormatSymbols)1 Locale (java.util.Locale)1 JspException (javax.servlet.jsp.JspException)1