I have a .gsp, that displays a number in the page. The problem is, i receive that number (from the server) with decimals, even if the decimal is 0. I would like to “if the last character in this string is 0, erase from the dot till the end”
Any idea? if possible, without touching the server side.
Thank you.
You’re better off treating numbers as numbers (parsing them if needed), and then using format tags that come bundled with Grails. In this case g:formatNumber would be appropriate.