You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by "G Kal (Jira)" <ji...@apache.org> on 2020/09/10 07:32:00 UTC

[jira] [Updated] (FREEMARKER-157) Custom number formats

     [ https://issues.apache.org/jira/browse/FREEMARKER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

G Kal updated FREEMARKER-157:
-----------------------------
    Description: 
Followed the exact steps as described at the project's [documentation|https://freemarker.apache.org/docs/pgui_config_custom_formats.html#pgui_config_custom_formats_ex_model_aware] but I cannot make my custom number formats to work.

For example when I run the template bellow:
{code:java}
${map.key?string.@base_8}
{code}
 I get this error:

 
{code:java}
For "." left-hand operand: Expected a hash, but this has evaluated to a string (wrapper: f.t.SimpleScalar):
==> map.key?string
{code}
I tried various combinations of . and @ operator, tried to wrap my map inside () but nothing seems to work.

 

Setting the number format globally (<#setting number_format="@base_8">) works, but this is not an option for me, as well as the model - aware formats. Is this functionality broken or removed, can I at least have a custom format function ? How can I achieve this?

  was:
Followed the exact steps as described at the project's [documentation|https://freemarker.apache.org/docs/pgui_config_custom_formats.html#pgui_config_custom_formats_ex_model_aware] but I cannot make my custom number formats to work.
{code:java}
${map.value?string.@base_8}
{code}
 


> Custom number formats
> ---------------------
>
>                 Key: FREEMARKER-157
>                 URL: https://issues.apache.org/jira/browse/FREEMARKER-157
>             Project: Apache Freemarker
>          Issue Type: Bug
>          Components: documentation
>    Affects Versions: 2.3.28, 2.3.29, 2.3.30
>            Reporter: G Kal
>            Priority: Major
>
> Followed the exact steps as described at the project's [documentation|https://freemarker.apache.org/docs/pgui_config_custom_formats.html#pgui_config_custom_formats_ex_model_aware] but I cannot make my custom number formats to work.
> For example when I run the template bellow:
> {code:java}
> ${map.key?string.@base_8}
> {code}
>  I get this error:
>  
> {code:java}
> For "." left-hand operand: Expected a hash, but this has evaluated to a string (wrapper: f.t.SimpleScalar):
> ==> map.key?string
> {code}
> I tried various combinations of . and @ operator, tried to wrap my map inside () but nothing seems to work.
>  
> Setting the number format globally (<#setting number_format="@base_8">) works, but this is not an option for me, as well as the model - aware formats. Is this functionality broken or removed, can I at least have a custom format function ? How can I achieve this?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)