[JavaScript] 小数点以下を丸める

  • 0
    Like
  • 0
    Comment
    More than 1 year has passed since last update.

    .toFixed()でできるよ

    var x = 5 / 3;
    console.log(x.toFixed(2));//小数点以下2桁まで