File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change 395395 power = Math . pow ( 10 , boundedPrecision ) ;
396396
397397 // Multiply up by precision, round accurately, then divide and use native toFixed():
398- 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 ) ;
407-
408- }
398+ output = ( roundingFunction ( ( value + 'e+' + boundedPrecision ) - 0.5 ) / power ) . toFixed ( boundedPrecision ) ;
399+
409400 if ( optionals > maxDecimals - boundedPrecision ) {
410401 optionalsRegExp = new RegExp ( '\\.?0{1,' + ( optionals - ( maxDecimals - boundedPrecision ) ) + '}$' ) ;
411402 output = output . replace ( optionalsRegExp , '' ) ;
You can’t perform that action at this time.
0 commit comments