I have a variable of decimal type and I want to check the number of digits before decimal point in it. What should I do? For example, 467.45 should
decimal
467.45
var sep = Convert.ToChar(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator); var count = d.ToString().TakeWhile(c => c != sep).Count();