You could compare the value of the number rounded to 3 decimal places with the original value.
if (Decimal.Round(valueDecimal, 3) != valueDecimal)
{
//Too many decimals
}
More Related Contents:
- Allow only decimal numbers in textbox in C#
- Remove trailing zeros
- How do you round a number to two decimal places in C#?
- When should I use double instead of decimal?
- Decimal precision and scale in EF Code First
- How To Represent 0.1 In Floating Point Arithmetic And Decimal
- Formatting a float to 2 decimal places
- Is a double really unsuitable for money?
- Why can’t I unbox an int as a decimal?
- Find number of decimal places in decimal value regardless of culture
- How to convert a Decimal to a Double in C#?
- What does the M stand for in C# Decimal literal notation?
- Best way to display decimal without trailing zeroes
- Problem parsing currency text to decimal type
- Format decimal for percentage values?
- Generating a Random Decimal in C#
- String to decimal conversion: dot separation instead of comma
- Conversion of a decimal to double number in C# results in a difference
- Rounding down to 2 decimal places in c#
- Performing Math operations on decimal datatype in C#?
- How to convert Decimal to Double in C#?
- Culture invariant Decimal.TryParse()
- Why c# decimals can’t be initialized without the M suffix?
- Why does a C# System.Decimal remember trailing zeros?
- Round a decimal to the nearest quarter in C#
- Why am I getting a compile error when multiplying a decimal by a literal value?
- How can I format decimal property to currency?
- How to round decimal value up to nearest 0.05 value?
- Double vs Decimal Rounding in C#
- Raising a decimal to a power of decimal?