SHARE
TWEET

c#-digits-after-dot-2

selnomeria Jul 7th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         private int digitsAfterDot2(double value)
  2.         {
  3.             bool start = false;
  4.             int count = 0;
  5.             foreach (var s in value.ToString())
  6.             {
  7.                 if (s == '.')
  8.                     start = true;
  9.                 else if (start)
  10.                     count++;
  11.             }
  12.             return count;
  13.         }
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