Freemarker format BigDecimal to German Locale not working properly

拈花ヽ惹草 提交于 2019-12-13 03:55:04

问题


Following the documentation of FreeMarker :

Using :

<#setting number_format="0.##">
<#setting locale="hu">
German people write: ${12345678}

Should output as shown in picture but instead what i get is the below :

For input new BigDecimal(4436372342.10) => 4 436 372 342,10

which doesn't have . but instead has spaces .

Why that happens ?


回答1:


Seems like there is a documentation error.

locale="hu"

sets a Hungarian locale. Its thousands separator is ' '.

To set a German locale, try

locale="de_DE" 

instead. That has '.' as thousands separator.



来源:https://stackoverflow.com/questions/55518965/freemarker-format-bigdecimal-to-german-locale-not-working-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!