Jump to content

Calculate reduction percentage

Recommended Posts

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 :


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


Link to comment
Share on other sites

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;

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...