freemarker数字格式化带来的操作问题

xiaoxiao2026-06-21  26

一、后台传到页面的数值格式问题

 

freemarker在解析数据格式的时候,自动默认将数字按3为分割(1,000),这个问题给操作带来一定的额外处理复杂度,解决方法有如下几种:     1、在模板中直接加.toString()转化数字为字符串,如:${languageList.id.toString()};     2、在freemarker配置文件freemarker.properties加<#setting number_format="#">或者      <#setting number_format="0">;     3、在模板中直接加<#setting number_format="#">或者<#setting number_format="0">,如:<#if AdminLanguagePaginationMsg?exists> <#setting number_format="#">

 

二、html代码转译

 

    在

        <#escape x as x?html>

<body>

             ...

             ...

         </body>

         </#escape>

相关资源:敏捷开发V1.0.pptx
转载请注明原文地址: https://www.6miu.com/read-5050544.html

最新回复(0)