我有一个Podio应用程序,它将两个不同的数字字段中的几个数字相乘(见截图),并将结果放在"Total to be Paid“字段中。问题是它不会四舍五入到小数点后两位。有些时候是这样,有些时候不是。有时它会显示3位小数,有时会比这多得多。我怎样才能把它四舍五入到小数点后两位?
我在计算字段中输入的代码是"$“+@工作小时数(来自timedoctor.com) *@小时费率
发布于 2017-01-08 09:08:30
请尝试:
function numberWithoutCommas(x) {
return parseFloat(x).toFixed(2).toString();
}
"$" + numberWithoutCommas(@Price * @Count)@Price和@Count必须替换为您的变量,在我的示例中它们是数字。
https://stackoverflow.com/questions/41524495
复制相似问题