Hi,
i have a class
class Foo {
BigInteger phase
BigDecimal amount
BigDecimal percent}
and want to use bindData to map some user input.
The user enters data in different formats for amount and percent
i.e. :
- amount : 100.000,00
- percent : 75,50%
bindData parses this to
- amount = 100000 (in GERMAN Locale)
- percent : 75.5
is there any way to force grails to format domain-fields using different formats? For the example i would use NumberFormat.getNumberInstance for amount and NumberFormat.getPercentInstance for percent using the current Locale....
I tried the CustomEditor thing, but this procedure is type-bound and will not work on two different formats using the same type...
Anybody any idea? ;)
Thanks, Alex