Grails
  1. Grails
  2. GRAILS-9036

g:formatNumber should support customizable display of the NaN value

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1-RC1
    • Component/s: TagLib
    • Labels:
      None
    • Patch attached:
      Yes
    • Testcase included:
      yes

      Description

      As of now if g:formatNumber is used with NaN value, the default value of DecimalFormatSymbols is returned (\uFFFD). This does not look nice in HTML output.
      We should have a way to customize the appearance of NaN values on the webpage. This could be easily done by adding a new attribute:

      <g:formatNumber number="${Double.NaN}" nan="n/a"/> 
      

      Obviously the Output should be "n/a"

      I've already fixed this locally and send a pull request soon.

        Activity

        Stefan Armbruster created issue -
        Show
        Stefan Armbruster added a comment - see https://github.com/grails/grails-core/pull/182
        graemerocher 18/Apr/2012 12:06 AM PDT
        View full commit
        Merge pull request #182 from sarmbruster/master

        Fix for GRAILS-9036
        Hide
        Graeme Rocher added a comment -

        Thanks!

        Show
        Graeme Rocher added a comment - Thanks!
        Graeme Rocher made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Fix Version/s 2.1 [ 12801 ]
        Assignee Graeme Rocher [ graemerocher ]
        Status Open [ 1 ] Closed [ 6 ]

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Stefan Armbruster
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development