Monday, October 12, 2015

Number formatting in FTL - Free marker template

Number formatting in FTL - Free marker template

Today, I have asked to display some system generated integer value in the Alfresco Share side. The number starts from 1000 and while rendering in the Alfresco Share side, it was displaying 
like, 1,000; 1,001;1,002 etc.

I looked at the code, there is no formatting string specified for the integer value, then I was googgle and I found the way to ignore the "," from the integer value.

<#assign intValue = 1000>
${intValue}                                    <#-- 1,000 -->
${intValue?string}                         <#-- 1,000 -->
${intValue?c}                                <#-- 1000 -->

${intValue?string.computer}         <#-- 1000 -->

Hope this helps someone.

No comments:

Post a Comment