File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 396396
397397 // Multiply up by precision, round accurately, then divide and use native toFixed():
398398 output = ( roundingFunction ( value + 'e+' + boundedPrecision ) / power ) . toFixed ( boundedPrecision ) ;
399+ if ( Number ( output ) > value ) {
400+ if ( output . includes ( '.' ) ) {
401+ l = output . split ( '.' ) [ 1 ] . length ;
402+ new_num = 10 ** ( - l ) ;
403+ new2_num = Number ( output ) - new_num ;
404+ output = new2_num . toString ( ) ;
405+ }
406+ output = ( roundingFunction ( output + 'e+' + boundedPrecision ) / power ) . toFixed ( boundedPrecision ) ;
399407
408+ }
400409 if ( optionals > maxDecimals - boundedPrecision ) {
401410 optionalsRegExp = new RegExp ( '\\.?0{1,' + ( optionals - ( maxDecimals - boundedPrecision ) ) + '}$' ) ;
402411 output = output . replace ( optionalsRegExp , '' ) ;
You can’t perform that action at this time.
0 commit comments