【问题标题】:NetSuite : ADV PDF Template toFixedNetSuite : ADV PDF 模板 toFixed
【发布时间】:2018-12-02 11:38:24
【问题描述】:



这里有人知道如何在 html 代码中保留小数位吗?

<#assign unitprice = item.itemunitprice/>
<td border-bottom="0" border-right="1" border-top="1" align="right">${unitprice}</td>

有时返回值是整数 {10,000} 或一 (1) 位小数 {10,000.8}。
有没有办法让显示值变成 {10,000.00} 或 {10,000.80}。
希望你能帮我!提前致谢!!

【问题讨论】:

    标签: html netsuite


    【解决方案1】:

    试试这个。

    ${unitprice?string.currency}
    

    【讨论】:

    • 已经试过这个但返回错误。 For "." left-hand operand: Expected a hash, but this has evaluated to a string (wrapper: f.t.SimpleScalar): ==> unitprice?string [in template "template" at line 190, column 79] ---- FTL stack trace ("~" means nesting-related): - Failed at: ${unitprice?string.currency} [in template "template" at line 190, column 77] ----
    • 奇怪,string.currency 是我使用的同一个东西。您是否在尝试打印数据之前验证数据是否正确?
    • @Saizou 我最近经常遇到这个错误。我花了几个小时试图“修复”它。这是因为 NetSuite 的 WYSWYG 编辑器试图验证所有内容。出于某种原因,它没有看到它们真正的字段类型。无论如何尝试保存您的模板,但出现错误。然后去测试打印。我猜它会正常工作,除非有其他错误。
    【解决方案2】:

    我也使用 ?string.currency。此外,要访问销售订单的价格,我通常使用 item.amount,不确定这是否会改变任何内容。

    【讨论】:

      猜你喜欢
      • 2014-05-08
      • 2017-05-26
      • 2018-10-20
      • 2022-12-04
      • 2019-07-18
      • 2017-02-19
      • 2016-10-01
      • 1970-01-01
      • 2023-01-31
      相关资源
      最近更新 更多