Olivier Posted February 21, 2014 Share Posted February 21, 2014 Hi friends, I have a case where the user will enter a original price and a new reduced price, and we want a field to be calculated with the reduction percentage (-30%, -40%...). Like in this screenshot : http://forums.printable.com/attachment.php?attachmentid=981&stc=1&d=1392991331 The user will enter 119.99 and 69.99 and we would like the "-41%" to be calculated using a rule. How may we do that ? Using FP 9.1 and MarcomCentral. Thanks for your help ! Olivier from France Quote Link to comment Share on other sites More sharing options...
step Posted February 21, 2014 Share Posted February 21, 2014 Please note I used the Math.ceil property since we are dealing with negative numbers. var was = Int(Field("was price")); // 119.99 var now = Int(Field("now price")); // 69.99 var reduction = Math.ceil(((now - was) / was)*100) + "%"; return reduction; Quote Link to comment Share on other sites More sharing options...
Olivier Posted February 21, 2014 Author Share Posted February 21, 2014 Thank you Step, it is very simple ! Have a nice day, Olivier Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.