#Math.pow()
成功
function round(num){
let r = num*Math.pow(10,d);
r = Math.round(num);
return num/Math.pow(10,d);
}
失敗
function round(num){
let r = numMath.pow(10,d);
r = Math.round(r);
return numMath.pow(10,-1*d);
}
書きかけ
Go to list of users who liked
More than 5 years have passed since last update.
#Math.pow()
成功
function round(num){
let r = num*Math.pow(10,d);
r = Math.round(num);
return num/Math.pow(10,d);
}
失敗
function round(num){
let r = numMath.pow(10,d);
r = Math.round(r);
return numMath.pow(10,-1*d);
}
書きかけ
Register as a new user and use Qiita more conveniently
Go to list of users who liked