【问题标题】:Podio app calculation - round off to two decimal placesPodio 应用程序计算 - 四舍五入到小数点后两位
【发布时间】:2017-01-07 17:44:26
【问题描述】:
我有一个 Podio 应用程序,它将两个不同数字字段中的几个数字相乘(请参阅屏幕截图),并将结果放入“待支付总额”字段中。问题是它没有四舍五入到小数点后两位。有时会,有时不会。有时它显示 3 个小数位,有时远不止这些。我怎样才能让它四舍五入到小数点后两位?
我在计算字段中输入的代码是
"$" + @Number of Hours Work(来自 timedoctor.com)* @Hourly Rate
http://screencast.com/t/85cxDP2CUWJ
【问题讨论】:
标签:
decimal
podio
calculation
【解决方案1】:
请尝试:
function numberWithoutCommas(x) {
return parseFloat(x).toFixed(2).toString();
}
"$" + numberWithoutCommas(@Price * @Count)
@Price 和 @Count 必须替换为您的变量,在我的示例中它们是数字。