<#--
* 隐藏银行帐号
-->
<#macro encBankAcct value=''>
<#--变量长度 -->
<#assign vlen = value?length>
<#compress>
<#if vlen lt 4>
${value}
<#else>
<#list 0..vlen - 4-1 as i>
<#t>*
<#if i !=0 && (i+1)%4 ==0>
</#if>
</#list>
<#t>${value?substring(vlen - 4, vlen)}
</#if>
</#compress>
</#macro>
<#--
* 隐藏证件号码
-->
<#macro encCertNo value=''>
<#--变量长度 -->
<#assign vlen = value?length>
<#compress>
<#if vlen lt 4>
${value}
<#else>
<#list 0..vlen - 4-1 as i>
<#t>*
</#list>
<#t>${value?substring(vlen -4, vlen)}
</#if>
</#compress>
</#macro>
<#-- 银行卡号格式-->
<#macro encBankNo value=''>
<#assign vlen = value?length>
<#compress>
<#if vlen lt 4>
${value}
<#else>
<#list 0..vlen - 4-1 as i>
<#if i != 0 && (i+1)%4 ==0>
<#elseif i != 0 && i%4 ==0 || i == 0 && i%4 ==0>
${value?substring(i, i+4)}
</#if>
</#list>
<#t>${value?substring(vlen - 4, vlen)}
</#if>
</#compress>
</#macro>
格式化银行帐号,四位加空格
最新推荐文章于 2023-04-12 17:14:46 发布