|
Erasmus Wanderer
Joined: 04 Aug 2004 Posts: 82 Location: Philadelphia
|
Posted: Wed Aug 04, 2004 4:46 am
Performing calculations in an #IF command |
I'm trying to test a condition in an #IF command that checks to see if the price in a store is more than 10% less than a price stored in a variable. What I have is:
#IF (%2<@Price*.9) {Price=%2}
The .9 seems to be causing the condition to fail but I can't figure out why and I don't know how to fix it.
Help would be appreciated. |
|
_________________ Erasmus |
|
|
|
jessew Apprentice
Joined: 03 Mar 2003 Posts: 141
|
Posted: Wed Aug 04, 2004 6:23 am |
#IF (%2<@Price*%float(.9)) {Price=%2} should do it.
Cheers |
|
_________________ I love deadlines. I like the whooshing sound they make as they fly by. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Aug 04, 2004 2:57 pm |
It's also quite simple to modifiy the formula to use integers.
#IF (%2 < (@Price * 9)/10) {Price = %2} |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
|
|