Using FreeMarker, I want to display a date into milliseconds:
${mydate?long}
but I get as output a comma separated millisecond:
524,354,400,000
is there any built-in function in Freemarker to remove comma ?
Thanks
It looks like as of version 2.3.17
you can use:
${myDate?long?c}
${myDate?c}
will suffice, assuming that myDate
is already a long/int.
Oct 1, 2019 at 21:57
As an alternative you could write on your Freemarker template this directive:
<#setting number_format="computer">
This will remove all commas from numbers.
This works fine for Freemarker 2.3.23
More info about these directives can be found here:
Adding to Gil's answer, if you build the configuration inside your code, you can set the flag globally by :
Configuration cfg = new Configuration();
...
cfg.setNumberFormat("computer");
Copied from the comment of the accepted answer,
In my version (2.3.26), simply ${myDate?c} will suffice, assuming that myDate is already a long/int.
This is worked for me
Thank you