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
simple :
string value = "467.45"; int count = value.split('.')[0] == "0" ? 0 : value.split('.')[0].ToString().Replace("-","").Count();