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
I would prefer the following instead of casting to int to ensure that you can also handle big numbers (e.g. decimal.MaxValue):
int
decimal.MaxValue
Math.Truncate ( Math.Abs ( decValue ) ).ToString( "####" ).Length