fix: use fixed precision for percentage
This commit is contained in:
+2
-1
@@ -123,7 +123,8 @@ function formatValue(
|
|||||||
): string {
|
): string {
|
||||||
if (value == null) return "0";
|
if (value == null) return "0";
|
||||||
const name = String(key);
|
const name = String(key);
|
||||||
if (percentageList.includes(name)) return `${roundPercent(value)}%`;
|
if (percentageList.includes(name))
|
||||||
|
return `${roundPercent(value).toFixed(1)}%`;
|
||||||
// if (/HP|ATTACK|DEFENSE|CUR_ATTACK|MAX_HP|CUR_DEFENSE/.test(name))
|
// if (/HP|ATTACK|DEFENSE|CUR_ATTACK|MAX_HP|CUR_DEFENSE/.test(name))
|
||||||
// return Math.round(Number(value)).toString();
|
// return Math.round(Number(value)).toString();
|
||||||
return Math.round(Number(value)).toLocaleString();
|
return Math.round(Number(value)).toLocaleString();
|
||||||
|
|||||||
Reference in New Issue
Block a user