File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments