code


In services/Util.grails

def public static round2={x| Math.round(x*100)/100}

while in the controllers you can call:

Util.round2.call(ter)

Note: Util.round2(ter) does NOT work if the definition is the service while it works in the console

In formtaglib.groovy:

def dateFormat = { attrs ->
out << new java.text.SimpleDateFormat(attrs.format).format(attrs.date)
}

And in the page:

<g:dateFormat format=”dd-MM-yyyy” date=”${ter.date}”/>