Use Different Locale for @NumberFormat in Spring

前端 未结 1 1957
耶瑟儿~
耶瑟儿~ 2021-01-13 10:03

I am working on a Spring 3 project and I need to format a Long field for Turkish currency. The default Locale of the application is en_US

1条回答
  •  孤独总比滥情好
    2021-01-13 10:41

    There are many ways but you could for example register a custom implementation of AnnotationFormatterFactory as a bean which would allow you to handle the formatting manually. This is documentented in the Spring documentation section 6.6. The example in the documentation even handles the use case of adjusting @NumberFormat's behavior.

    0 讨论(0)
提交回复
热议问题