📜  js arrotondare numeri - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:48.110000             🧑  作者: Mango

代码示例3
function ceilTo(value, places){
     var power = Math.pow(10, places);
     return Math.ceil(value * power) / power;
 }
 function floorTo(value, places){
     var power = Math.pow(10, places);
     return Math.floor(value * power) / power;
 }