瀏覽代碼

Fix "undefined" appearing when rendering small numbers

tags/v0.1.0
Fen Dweller 5 年之前
父節點
當前提交
026bb67c64
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: E80B35A6F11C3656
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      numbers.js

+ 2
- 2
numbers.js 查看文件

@@ -6,7 +6,7 @@ function numberTextSmall(val, places = 1, smallPlaces = 0) {
if (isNaN(val)) { if (isNaN(val)) {
throw new RangeError("Invalid number: " + val); throw new RangeError("Invalid number: " + val);
} }
if (val < Math.pow(10, (places+2))) {
if (val < Math.pow(10, (places+3))) {
return round(val, smallPlaces); return round(val, smallPlaces);
} }


@@ -26,7 +26,7 @@ function numberText(val, places = 1, smallPlaces = 0) {
if (isNaN(val)) { if (isNaN(val)) {
throw new RangeError("Invalid number: " + val); throw new RangeError("Invalid number: " + val);
} }
if (val < Math.pow(10, (places+2))) {
if (val < Math.pow(10, (places+3))) {
return round(val, smallPlaces); return round(val, smallPlaces);
} }




Loading…
取消
儲存