daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         public static int NumberOfDecimalPlaces(string number)
  2.         {
  3.             if (number.Contains(DecimalSymbol))
  4.             {
  5.                 string[] numbersplit = number.Split(charDecimalSymbol);
  6.                 return numbersplit[1].ToString().Length;
  7.             }
  8.             else
  9.             {
  10.                 return 0; //no decimal places.
  11.             }
  12.         }
  13.  
  14.         public static int NumberOfDecimalPlaces(int number)
  15.         {
  16.             return NumberOfDecimalPlaces(number.ToString());
  17.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top