Skip to content

Commit cf02825

Browse files
committed
fix: resolve eslint 10 lint errors
1 parent 04114f6 commit cf02825

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

src/numberUtil.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,12 @@ function expandScientificNotation(parsed: ParsedScientificNotation) {
109109
const initialDecimalIndex = integerDigits || -leadingDecimalZeros;
110110
const decimalIndex = initialDecimalIndex + exponent;
111111

112-
let expanded = '';
113-
114-
if (decimalIndex <= 0) {
115-
expanded = `0.${'0'.repeat(-decimalIndex)}${digits}`;
116-
} else if (decimalIndex >= digits.length) {
117-
expanded = `${digits}${'0'.repeat(decimalIndex - digits.length)}`;
118-
} else {
119-
expanded = `${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}`;
120-
}
112+
const expanded =
113+
decimalIndex <= 0
114+
? `0.${'0'.repeat(-decimalIndex)}${digits}`
115+
: decimalIndex >= digits.length
116+
? `${digits}${'0'.repeat(decimalIndex - digits.length)}`
117+
: `${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}`;
121118

122119
return `${negative ? '-' : ''}${expanded}`;
123120
}

0 commit comments

Comments
 (0)