Closed GoogleCodeExporter closed 9 years ago
Are you thinking you could set a 'locale' property on the TypeHandler
declaration? Or that 'locale' would be a new attribute on a field declaration?
And then I assume you are using the locale to get a DecimalFormatSymbols
instance to set on the DecimalFormat, right? Or is there another way I don't
know about?
Thanks,
Kevin
Original comment by kevin.s...@gmail.com
on 19 Jun 2013 at 1:57
This is the implemented workaround:
public class BigDecimalUsLocaleTypeHandler extends BigDecimalTypeHandler {
@Override
protected DecimalFormat createDecimalFormat() {
return new DecimalFormat(getPattern(), DecimalFormatSymbols.getInstance(Locale.US));
}
}
I think that the most common scenario will probably be to use the same locale
all along the project. In this scenario, overriding the locale property on the
TypeHandler declaration will do.
Another posibility is to have a global property that configures all handlers so
in case I wish to use the same locale on different handlers I don't need to
configure them individually.
Thanks.
Original comment by fbar...@scanntech.com
on 19 Jun 2013 at 2:01
Thanks, that makes sense to me- I'll look into supporting both of your
suggestions for 2.1.x.
Original comment by kevin.s...@gmail.com
on 19 Jun 2013 at 2:32
Modified for 2.1.0.M2. Snapshot JAR attached.
Original comment by kevin.s...@gmail.com
on 23 Sep 2013 at 4:06
Attachments:
Original comment by kevin.s...@gmail.com
on 16 Nov 2013 at 5:29
Original issue reported on code.google.com by
fbar...@scanntech.com
on 18 Jun 2013 at 9:56