Element: Custom Math

Created by Mike B, Modified on Thu, 23 May at 2:25 PM by Mike B


The Custom Math element is for businesses looking to adjust their pricing dynamically. 

It allows users to apply basic math operations (+, -, *, %) to either a group of products/services (sub-section total) or the entire calculator total. Ideal for adding fees, offering discounts, or converting yearly costs to monthly prices, it can be used with or without conditional logic. 

Whether adding a shipping fee or providing a 10% discount on a sub-section total, Custom Math offers flexibility and precision. It’s perfect for scenarios like imposing setup fees or adjusting pricing based on user selections. 

Custom Math Element vs Variable Math Element

FeatureCustom MathVariable Math
Key Differences
  • Affects section or calculator total
  • Uses basic math operations (+, -, *, %)
  • Can apply fees or discounts
  • Works conditionally or unconditionally
  • Ideal for dynamic pricing adjustments
  • Calculates individual product/service cost
  • Uses complex formulas with variables
  • Handles specific pricing models
  • Can include conditional logic
  • Ideal for detailed cost calculations
Use Cases
  1. Adding a shipping fee
  2. Applying a discount
  3. Converting yearly to monthly pricing
  4. Imposing setup fees
  5. Triggering charges based on selections
  1. Pricing backyard fences
  2. Calculating shipping rates based on dimensions
  3. Mortgage calculator
  4. Loan calculator with interest
  5. Package deals with combined item discounts
  • 10% off a section total
  • Flat $5 shipping fee
  • Fence cost = Length x Width x Height
  • Shipping cost = Length x Width x Height / 30

Benefits, Features & Use Cases

  1. Base Price - Create a base price for your product or service. Base Price: The most fundamental cost of a good or service to a consumer that does not include common extra fees. In addition to the base price of a product, fees that raise the overall price to buyers are often assessed by sellers for such things as sales tax, shipping charges, and extra equipment or supply options.

  2. Convert to Monthly pricing - If your pricing is set up to show the yearly pricing, but you want to convert it to a monthly cost in the front end, you can add "Divide by 12" to give the monthly price. We recommend using the Multiple Totals features to achieve a 'monthly pricing' result.

  3. Shipping Cost - If you charge a base fee for shipping, you can use this feature to show that.

  4. Setup Fees - impose a fixed dollar amount or percentage fee that is applicable to the total cost of the entire calculator.

  5. Trigger Fee(s) - Add conditional logic to your custom math element to trigger a charge.
    • Video #10 - trigger a discount or fee with custom math and conditional logic

  6. Trigger Discount(s) - Add conditional logic to your custom math element to trigger a charge.
    • Video #10 - trigger a discount or fee with custom math and conditional logic 

How to Activate & Use This Feature

First, click on the "+Add Element" button

Then, click on the "Custom Math" box

Settings & Options

First, we can set a name for this element

Now, we have the "Type" and here is when the magic comes...

There are 5 operators you can use with Custom Math.

Addition (+) = This will add whatever value you give it, in a dollar amount.
Minus (-) = This will remove whatever value (a dollar amount) that you choose.
Divide (/) = This will divide the sub-section total by the number given.
Percentage (%) - This will take the sub-section total and apply an additional percentage amount to it.
Multiply (X) - This will multiply the sub-section total by a given amount that you choose.

You can choose how the custom math is displayed

  1. Hidden (affects price in the background) 
  2. Display On Frontend
  3. Display on Detailed List & PDF 
  4. Show in Backend & Frontend
  5. Affect Calculator Total (by default it will only apply math to the subsection total)

In this example, we're using conditional logic with custom math to trigger an artwork setup fee if the user selects logo design.

 Video Tutorial

 Additional Information 

The custom math feature can be set up to automatically add, subtract, multiply or divide a given value (not percentage). It does not have a toggle switch for the frontend, meaning the user cannot click anything to trigger custom math.

Custom math cannot do variable math, commonly found in other complex cost calculator plugins. Keep in mind, that the Stylish Cost Calculator plugin was designed for ease of use and not for complex situations.

The custom math element works at the subsection level, unless you activate the 'Apply Math to Calculator Total' option so that it applies to the calculator total.

Related features:


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article