
Originally Posted by
Mikaelul
Hello there,
I’m currently trying to rectify an old if-statement from a program where I want the following to happen:
If a number in a specified cell is a whole number (like 4), then I want it to do the following calculation:
h = bunn * 5 + 2 (where "bunn" is my specified value).
If the number in the specified cell has decimals (like 4.3) then I want this equation to be executed:
h = bunn * 5 + 1
If somebody can help me out with this issue I would appreciate it greatly.
Does this work if you implement this same idea into your code? Essentially it is converting the decimal of type double to an integer and storing it as a separate variable. If the two variables (original number and new integer) are equal, we have a whole number. However, if they are not equal, the new variable chopped off the decimal when it converted it to an integer. Let me know if this is what you need.
Bookmarks