Merge pull request #944 from kuangshen04/PR-Branch

bugfix
This commit is contained in:
Spmario233 2024-02-14 18:51:17 +08:00 committed by GitHub
commit 40a8431896
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -2238,8 +2238,8 @@ export class Get extends Uninstantable {
static cnNumber(num, ordinal) { static cnNumber(num, ordinal) {
if (isNaN(num)) return ''; if (isNaN(num)) return '';
let numStr = num.toString(); let numStr = num.toString();
if (num === 'Infinity') return '∞'; if (numStr === 'Infinity') return '∞';
if (num === '-Infinity') return '-∞'; if (numStr === '-Infinity') return '-∞';
if (!/^\d+$/.test(numStr)) return num; if (!/^\d+$/.test(numStr)) return num;
const chars = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']; const chars = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
@ -2253,7 +2253,7 @@ export class Get extends Uninstantable {
numStr = numStr.replace(/(?=(\d{4})+$)/g, ',').split(',').filter(Boolean); numStr = numStr.replace(/(?=(\d{4})+$)/g, ',').split(',').filter(Boolean);
const handleZero = str => { const handleZero = str => {
let result = str.replace(/零{2,}/g, '零'); let result = str.replace(/零{2,}/g, '零');
if (result.length > 1) replace(/零+$/g, ''); if (result.length > 1) result = result.replace(/零+$/g, '');
return result; return result;
}; };
const _transform = str => { const _transform = str => {

View File

@ -2949,9 +2949,8 @@ export class Player extends HTMLDivElement {
numh = arguments[0]; numh = arguments[0];
} }
if (numh >= 10) { if (numh >= 10) {
numh = numh.toString();
this.node.count.dataset.condition = 'low'; this.node.count.dataset.condition = 'low';
this.node.count.innerHTML = numh[0] + '<br>' + numh[1]; this.node.count.innerHTML = Array.from(numh.toString()).join('<br>');
} }
else { else {
if (numh > 5) { if (numh > 5) {