I have a Double value:
double a = 4.5565;
What is the easiest way to calculate the number of digits after the decimal point (4 in this case
Write a function
int CountDigitsAfterDecimal(double value) { bool start = false; int count = 0; foreach (var s in value.ToString()) { if (s == '.') { start = true; } else if (start) { count++; } } return count; }