Grails - How to format a value in a textfield into comma style such that it can be easily read?

Posted by WaZ on Stack Overflow See other posts from Stack Overflow or by WaZ
Published on 2010-05-20T09:24:02Z Indexed on 2010/05/20 9:30 UTC
Read the original article Hit count: 306

Filed under:

Hi there,
I want to allow users enter numbers in textfield and once the textbox loses focus. The number is formatted with commas.

e.g. User enters 100000
textfield looses focus
value displayed: 100,000

How can I achieve this in Grails.

I have looked at

<g:formatNumber number="${myNumber}" format="\\$###,##0" />

But it doesnt solve my problem as the number is from a textfield.

thanks

Much appreciated.

© Stack Overflow or respective owner

Related posts about grails