Menu

formatting currency gives illegal arg. exc.

Help
Pierce
2007-09-17
2012-10-09
  • Pierce

    Pierce - 2007-09-17

    After looking through the tutorials and online examples, I have come to the forum to ask for help with this problem. I am trying to get a numeric column formatted as currency and totaled. I am getting the following error when I try to do this:
    MessageFormatColumnDecorator.decorate(66) | Caught an illegal argument exception while trying to format an object with pattern {0,number,currency}, returning the unformatted value. Object class is {0,number,currency}

    The table in the JSP starts off as:
    <display:table name="orderList" cellspacing="0" cellpadding="0" requestURI=""
    id="orderList" pagesize="500" class="list" export="true" sort="list" decorator="org.displaytag.decorator.TotalTableDecorator" >

    The offending column is defined as:
    <display:column media="csv excel pdf html" property="totalPriceAmount" escapeXml="true" sortable="false" title="Subtotal" headerClass="r" class="r" format="{0,number,currency}" total="true" />

    Now, here's the somwehat-weird part:
    The error is thrown and the HTML displayed has no formatting:
    1018.6000,
    but the total that comes out is different:
    1018.6

    I would have expected the formatting to be the same on both.

    Now here's the really weird part:
    The format of the column in the excel spreadsheet looks just fine. It's $1,018.60.

    The really really weird part is that the spreadsheet has no total at all, where the HTML at least has one, but it's unformatted.

     
    • Pierce

      Pierce - 2007-09-20

      Anybody?

       
      • Honza

        Honza - 2007-09-20

        If you could send me your code ( jsp & java), I might be able to tell you what's wrong ...

        Honza

         

Log in to post a comment.