xsj1989

code

function toThousands(num) {
if (isNaN(num) || num == undefined || num == null || num == "") {
return "";
}
num = num.toString();
var numArr = num.split(\'.\');
num = numArr[0];
var result = \'\';
while (num.length > 3) {
result = \',\' + num.slice(-3) + result;
num = num.slice(0, num.length - 3);
}
if (num) { result = num + result; }
return result + \'.\' + numArr[1];
}

//四舍五入保留两位小数

var ta = (Math.round(6.327 * 100) / 100).toFixed(2);
C#:var grossWt = Math.Round(grossWt, 3, MidpointRounding.AwayFromZero);

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-12-18
  • 2021-08-21
猜你喜欢
  • 2022-12-23
  • 2021-12-18
  • 2022-01-22
  • 2021-11-24
  • 2021-06-18
  • 2022-12-23
  • 2021-06-02
相关资源
相似解决方案