Tries to remove commas from Long numbers in Grails app

I have this code:

    <g:link action="edit" id="${testObjectResults.id}">
               ${fieldValue(bean: testObjectResults, field: "id")}


links create links, identification numbers, with commas in them; I don't want commas. I tried this.

   <g:link action="edit" id="${testObjectResults.id}">
          <g:formatNumber number="${fieldValue(bean: testObjectResults, field: "id")}"
                     type="number" minIntegerDigits="1" />


But it didn't work. I am using Grails 2.3.9. I tried stuff from this page: http://grails.org/doc/2.3.9/ref/Tags/formatNumber.html but it doesn't work.


source to share

2 answers


format the number itself, try this

<g:link action="edit" id="${testObjectResults.id}">




you have 3 options:

  • specify @format


    <g:formatNumber number="${number}" type="number" format="######"/>

  • specify @locale

    which does not use group splitting:

    <g:formatNumber number="${number}" type="number" locale="${Locale.GERMANY}"/>

  • set as the default Locale

    (which does not use group separation) for the entire application to get rid of commas everywhere



All Articles