function changeTwoDecimal_f(x) {
var f_x = parseFloat(x);
if (isNaN(f_x)) {
alert('function:changeTwoDecimal->parameter error');
return false;
}
var f_x = Math.round(x * 10) / 10;
var s_x = f_x.toString();
var pos_decimal = s_x.indexOf('.');
if (pos_decimal < 0) {
pos_decimal = s_x.length;
s_x += '.';
}
while (s_x.length <= pos_decimal + 1) {
s_x += '0';
}
return s_x;
}

相关文章:

  • 2022-01-19
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2022-02-28
猜你喜欢
  • 2022-01-28
  • 2021-12-12
  • 2021-07-14
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案