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

        Show
        Stefan Armbruster added a comment - see https://github.com/grails/grails-core/pull/182
        Hide
        Graeme Rocher added a comment -

        Thanks!

        Show
        Graeme Rocher added a comment - Thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development