Re: [Freemarker-devel] how to easier setup custom number format
Generates text that depends on changing data (like dynamic HTML).
Brought to you by:
revusky
From: Daniel D. <dd...@fr...> - 2017-11-28 17:01:47
|
Hi, Such formatting rule can be implemented in Java with a custom TemplateNumberFormatFactory. See: https://freemarker.apache.org/docs/pgui_config_custom_formats.html Note that this list is retired; see: https://freemarker.apache.org/mailing-lists.html Tuesday, November 28, 2017, 4:58:50 PM, alekz wrote: > Hi, everyone. > Advise me please, how I can implement easier number format: > I need format like this : "1 000,10" (with group Separator " "(space) and > decimalSeparator "," ), > and if number have decimal part <0 like 1 000,00 don't show decimal = 1 000 > and if number have decimal part >0 -- show two symbol after coma like 1 > 000,10??? > > > I implemented it's now too difficult > > I set in javaClass > Freemarker.configuration.setLocale("hu") ; > Freemarker.configuration.setNumber format("##0,00"); > > and into template I used replace like ${amoun?replace(',00','')} > > but in this case I have to write replace for all tag wich contains number (( > > > thanks) > > > > -- > Sent from: > http://freemarker.624813.n4.nabble.com/freemarker-devel-f626829.html > -- Thanks, Daniel Dekany |