Fix .toFixed() string-to-number comparison by wrapping with Number()
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -340,7 +340,7 @@ const secondaryStatData = ref(null);
|
||||
* @returns {number} The percentage value.
|
||||
*/
|
||||
const getPercentLabel = (val) => {
|
||||
if ((val * 100).toFixed(1) >= 100) return 100;
|
||||
if (Number((val * 100).toFixed(1)) >= 100) return 100;
|
||||
else return parseFloat((val * 100).toFixed(1));
|
||||
};
|
||||
|
||||
|
||||
@@ -641,7 +641,7 @@ function progressWidth(value) {
|
||||
* @returns {string} The formatted percentage string.
|
||||
*/
|
||||
function getPercentLabel(val) {
|
||||
if ((val * 100).toFixed(1) >= 100) return `100%`;
|
||||
if (Number((val * 100).toFixed(1)) >= 100) return `100%`;
|
||||
else return `${(val * 100).toFixed(1)}%`;
|
||||
}
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ function barOptions() {
|
||||
* @returns {string} The formatted percentage string.
|
||||
*/
|
||||
function getPercentLabel(val) {
|
||||
if ((val * 100).toFixed(1) >= 100) return 100;
|
||||
if (Number((val * 100).toFixed(1)) >= 100) return 100;
|
||||
else return parseFloat((val * 100).toFixed(1));
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@ function switchTab(newTab) {
|
||||
* @returns {string} The formatted percentage string.
|
||||
*/
|
||||
function getPercentLabel(val) {
|
||||
if ((val * 100).toFixed(1) >= 100) return `100%`;
|
||||
if (Number((val * 100).toFixed(1)) >= 100) return `100%`;
|
||||
else return `${(val * 100).toFixed(1)}%`;
|
||||
}
|
||||
|
||||
|
||||
@@ -540,7 +540,7 @@ function moment(time) {
|
||||
* @returns {string} The formatted percentage string.
|
||||
*/
|
||||
function getPercentLabel(val) {
|
||||
if ((val * 100).toFixed(1) >= 100) return `100%`;
|
||||
if (Number((val * 100).toFixed(1)) >= 100) return `100%`;
|
||||
else return `${(val * 100).toFixed(1)}%`;
|
||||
}
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ watch(infiniteFirstCases, (newValue) => {
|
||||
* @returns {string} The formatted percentage string.
|
||||
*/
|
||||
function getPercentLabel(val) {
|
||||
if ((val * 100).toFixed(1) >= 100) return `100%`;
|
||||
if (Number((val * 100).toFixed(1)) >= 100) return `100%`;
|
||||
else return `${(val * 100).toFixed(1)}%`;
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ const statData = ref(null);
|
||||
* @returns {number} The percentage value.
|
||||
*/
|
||||
function getPercentLabel(val) {
|
||||
if ((val * 100).toFixed(1) >= 100) return 100;
|
||||
if (Number((val * 100).toFixed(1)) >= 100) return 100;
|
||||
else return parseFloat((val * 100).toFixed(1));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user