a guest Feb 19th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- public static int NumberOfDecimalPlaces(string number)
- if (number.Contains(DecimalSymbol))
- string numbersplit = number.Split(charDecimalSymbol);
- return numbersplit.ToString().Length;
- return 0; //no decimal places.
- public static int NumberOfDecimalPlaces(int number)
- return NumberOfDecimalPlaces(number.ToString());
RAW Paste Data