private Formatter<Number> configureFormatterFrom(NumberFormat annotation, Class<?> fieldType) {
if (StringUtils.hasLength(annotation.pattern())) {
return new NumberFormatter(annotation.pattern());
}
else {
Style style = annotation.style();
if (style == Style.PERCENT) {
return new PercentFormatter();
}
else if (style == Style.CURRENCY) {
return new CurrencyFormatter();