File tree Expand file tree Collapse file tree
src/Solana.Unity.Dex/Math Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,12 +150,12 @@ public static Percentage FromDouble(double dValue)
150150 {
151151 double dTemp = dValue ;
152152 long iMultiple = 1 ;
153- string strTemp = dValue . ToString ( ) ;
153+ string strTemp = dValue . ToString ( System . Globalization . CultureInfo . InvariantCulture ) ;
154154 while ( strTemp . IndexOf ( "E" ) > 0 ) // if in the form like 12E-9
155155 {
156156 dTemp *= 10 ;
157157 iMultiple *= 10 ;
158- strTemp = dTemp . ToString ( ) ;
158+ strTemp = dTemp . ToString ( System . Globalization . CultureInfo . InvariantCulture ) ;
159159 }
160160 int i = 0 ;
161161 while ( strTemp [ i ] != '.' )
@@ -176,9 +176,9 @@ public static Percentage FromDouble(double dValue)
176176 {
177177 throw new PercentageException ( "Conversion not possible due to overflow" ) ;
178178 }
179- catch ( Exception )
179+ catch ( Exception exp )
180180 {
181- throw new PercentageException ( "Conversion not possible" ) ;
181+ throw new PercentageException ( "Conversion not possible: " + exp . Message ) ;
182182 }
183183 }
184184
You can’t perform that action at this time.
0 commit comments