Re: how to easier setup custom number format
Daniel Dekany <[email protected]> Tue, 28 Nov 2017 17:39:53 +0100
| Newsgroups | gmane.comp.web.freemarker.devel |
|---|---|
| Message-ID | <[email protected]> |
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
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot