Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6220515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:58:08+00:00 2026-05-24T07:58:08+00:00

Im using displaytag 1.2 and fmt tags: <%@ taglib uri=http://java.sun.com/jsp/jstl/fmt prefix=fmt %> <%@ taglib

  • 0

Im using displaytag 1.2 and fmt tags:

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>

Im trying to use displaytags format-attribute to format a number to a currency. However it seems as displaytag renders the currency-format different than fmt-numberformat. This causes inconsistens in my page and needs to be resolved.
Ex. Displaytag formats local currency like this: NOK 1,500.00
Ex. FMT formats local currency like this: kr 1 500,00

The FMT version is correct, so i would like to use the same format in displaytag.
How can i get displaytag to format in the correct way?

Preferably without decorators.

This is my current jsp-code snippets:

<fmt:formatNumber type="currency"><s:property value="reportFooter.pris" /></fmt:formatNumber>
<display:column property="pris" sortable="true" titleKey="report.header.price" format="kr {0,number,currency}"/>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:58:11+00:00Added an answer on May 24, 2026 at 7:58 am

    This is a cheap test:

    int i = 1000;
    MessageFormat mf = new MessageFormat("{0,number,currency}", new Locale("no", "NO"));
    System.out.println(mf.format(new Object[] {new Integer(i)}));
    

    Prints out kr 1 000,00

    int i = 1000;
    MessageFormat mf = new MessageFormat("{0,number,currency}", new Locale("en", "NO"));
    System.out.println(mf.format(new Object[] {new Integer(i)}));
    

    Prints out NOK1,000.00

    Your problem is that you did not configure displaytag’s LocaleResolver correctly. It has Norway locale but with English language.

    Displaytag’s code is fine, it does exactly the same as I do in my test code:

    50  public MessageFormatColumnDecorator(String pattern, Locale locale)
    51 {
    52 this.format = new MessageFormat(pattern, locale);
    53 }

    58 public Object decorate(Object columnValue, PageContext pageContext, MediaTypeEnum media)
    59 {
    60 try
    61 {
    62 return this.format.format(new Object[]{columnValue});
    63 }
    64 catch (IllegalArgumentException e)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Displaytag to display the DataGrid. Now, I have to change the
I am using the java displaytag library. I need to show the headers in
i am using display tag for showing table in my jsp page. I need
I am using display tag to display data in a table on a JSP.
In jsp I'm using Display tag to print a table. I want to display
I am using the displaytag library to display a list of permission objects. The
I am using display tag in jsp page. I want to customize the display
I am using Displaytag framework for pagination & exporting purpose. In that i am
what is the best way of displaying/using the revision number in a java webapp?
i am using diaply tags library for displaying my tables.But i cant use the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.