@@ -853,7 +853,7 @@ private static string DoubleToFormatString(CodeContext/*!*/ context, double self
853853 // only have as single digit avoid exponents.
854854 if ( digitCnt > spec . Precision . Value && digitCnt != 1 ) {
855855 // first round off the decimal value
856- self = MathUtils . RoundAwayFromZero ( self , 0 ) ;
856+ self = MathUtils . Round ( self , 0 , MidpointRounding . AwayFromZero ) ;
857857
858858 // then remove any insignificant digits
859859 double pow = Math . Pow ( 10 , digitCnt - Math . Max ( spec . Precision . Value , 1 ) ) ;
@@ -868,7 +868,7 @@ private static string DoubleToFormatString(CodeContext/*!*/ context, double self
868868 // round to match CPython's behavior
869869 int decimalPoints = Math . Max ( spec . Precision . Value - digitCnt , 0 ) ;
870870
871- self = MathUtils . RoundAwayFromZero ( self , decimalPoints ) ;
871+ self = MathUtils . Round ( self , decimalPoints , MidpointRounding . AwayFromZero ) ;
872872 digits = self . ToString ( "0.0" + new string ( '#' , decimalPoints ) ) ;
873873 }
874874 } else {
@@ -898,7 +898,7 @@ private static string DoubleToFormatString(CodeContext/*!*/ context, double self
898898 // only have as single digit avoid exponents.
899899 if ( digitCnt > precision && digitCnt != 1 ) {
900900 // first round off the decimal value
901- self = MathUtils . RoundAwayFromZero ( self , 0 ) ;
901+ self = MathUtils . Round ( self , 0 , MidpointRounding . AwayFromZero ) ;
902902
903903 // then remove any insignificant digits
904904 double pow = Math . Pow ( 10 , digitCnt - Math . Max ( precision , 1 ) ) ;
@@ -934,7 +934,7 @@ private static string DoubleToFormatString(CodeContext/*!*/ context, double self
934934 }
935935 int decimalPoints = Math . Max ( precision - digitCnt , 0 ) ;
936936
937- self = MathUtils . RoundAwayFromZero ( self , decimalPoints ) ;
937+ self = MathUtils . Round ( self , decimalPoints , MidpointRounding . AwayFromZero ) ;
938938
939939 if ( spec . Type == 'n' && context . LanguageContext . NumericCulture != PythonContext . CCulture ) {
940940 if ( digitCnt != precision && ( self % 1 ) != 0 ) {
0 commit comments