[chronojump] New method: Util.DivideSafeAndGetInt()



commit 3924922ca00e7e99894780f0a93a24232ac9f137
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Jul 31 17:40:48 2019 +0200

    New method: Util.DivideSafeAndGetInt()

 src/util.cs | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/util.cs b/src/util.cs
index 979493dd..a16262b2 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -1998,6 +1998,12 @@ public class Util
                return val1 / val2;
        }
 
+       public static int DivideSafeAndGetInt (double val1, double val2)
+       {
+               return Convert.ToInt32(DivideSafe(val1, val2));
+       }
+
+
        /*
        //converts all values to positive
        public static string StringValuesAbsolute (string myString) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]