Code examples for org.springframework.format.annotation.NumberFormat

Codota analyzed 7,668,838 open source code samples to find the most common, credible and clear examples.
You can now enable Codota on your own code to easily search and navigate your Java codebase.
		return configureFormatterFrom(annotation); 
	} 
 
 
	private Formatter<Number> configureFormatterFrom(NumberFormat annotation) { 
		if (StringUtils.hasLength(annotation.pattern())) { 
			return new NumberFormatter(resolveEmbeddedValue(annotation.pattern())); 
		} 
		else { 
			Style style = annotation.style(); 
			if (style == Style.PERCENT) { 
				return new PercentFormatter(); 
			} 
			else if (style == Style.CURRENCY) { 
				return new CurrencyFormatter(); 
			} 
			else { 
				return new NumberFormatter(); 
			} 
		} 
Full Snippet Info
7
CodeRank