Search code examples
grailsgsp

Multipling a parameter in GSP grails view


I am trying to multiply a parameter in a GSP view like this:

<g:set var="denom" value="${ denomination.denomination.toDouble() * .01) }"/>

Grails keep screaming "unexpected token" with the '*' but it's totally fine when I try to add!!

<g:set var="denom" value="${ denomination.denomination.toDouble() + .01) }"/>

am i missing something?


Solution

  • This is actually caused by an extra ) after the .01. So your expression should be:

    <g:set var="denom" value="${ denomination.denomination.toDouble() * .01 }"/>