Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to do some input validation so to check if a value has no more
than 2 decimal digits. So 14.12 is valid but 14.123 is not. I have tried doing a check like this: If Int(inval * 100) < inval * 100 Then but this gets a rounding error with certain values like 2.22. If I subtract one side above from the other I get a difference on the order of 10^-21. So I tried rounding the numbers to do a test like this: If Round(Int(inval * 100), 10) < Round(inval * 100, 10) Then and this does something weird like rounding Round(Int(0.29 * 100), 10) to 28. Is there some simpler way to check that a number does not have too many decimal digits? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA write macro change column with 3 number digits to 4 digits the | Excel Discussion (Misc queries) | |||
How to check the decimal number of each cells vaue in the column | Excel Programming | |||
How to get excel to check last 2 digits in a 4 digit number | Excel Discussion (Misc queries) | |||
How to customize number to 10 digits including 2 digits after deci | Excel Worksheet Functions | |||
How to check the decimal point of floating number using macro??? | Excel Programming |