Uni CPO 4 Documentation
  • Introduction
  • Why Uni CPO?
  • Installation
    • Upgrade
  • How To Use
    • Plugin's Settings
    • Builder
      • Data Structure
      • General Settings
      • Non Option Variable (NOV)
      • Weight Conditional Logic
      • Dimensions Settings
      • Image Conditional Logic
      • Formula Conditional Logic
      • Dynamic labels for options/suboptions
      • Shipping Classes Conditional Logic
      • Cart Discounts
    • Basic Modules
      • Row
      • Column
      • Paragraph
      • Button
      • Image
    • Options
      • Text Input
      • Text Area
      • Select
      • Radio Inputs
      • Checkbox Inputs
      • Date Picker
      • File Upload
      • Dynamic Notice
      • Range Slider
      • Matrix
      • Extra Cart Button
      • Google Map
      • Distance by Postcode
      • Font Preview
    • Fields Conditional Logic
    • Validation Conditional Logic
    • Colorify Feature
    • Imagify Feature
    • "Free Sample" Feature
    • Arithmetic Operators
    • Manage Order Items
    • Suboptions export/import
  • For developers
    • Actions & Filters
    • JS events
    • Extending Uni CPO
  • Duplicating options and products
  • How to debug
  • Affiliation
  • Themes & Plugins Compatibility
    • Popup Maker How To
    • Boxtal
    • Pitchprint.com
    • NBDesigner
    • Toggle Tax For Woocommerce
  • FAQ
  • Refund Policy
  • Managing licenses and billing info
    • License Utilization
  • Uni CPO Add-ons
    • Custom dynamic SKU (paid)
      • Stock management based on dynamic SKU
    • "Send Inquiry" (free)
    • Hidden/disabled option (free)
Powered by GitBook
On this page
  • Arithmetic operators
  • Maths functions

Was this helpful?

  1. How To Use

Arithmetic Operators

Previous"Free Sample" FeatureNextManage Order Items

Last updated 5 years ago

Was this helpful?

Arithmetic operators

  • + (addition)

  • - (subtraction)

  • * (multiplication)

  • / (division)

  • ^ ()

Also, you can use ( and ) to make groups in maths formula. Example: (2+3)*3 results in 15, but 2+3*3 results in 18

Maths functions

  • floor(variable)

  • ceil(variable)

  • round(variable, precision)

  • min(var1, var2, ...)

  • minpositiveorzero(var1, var2, ...)

  • max(var1, var2, ...)

  • average(var1, var2, ...)

  • sum(var1, var2, ...)

  • rangesum(var1, var2, step)

  • power(var1, var2)

  • pi()

  • mod(var1, var2)

Some examples of using these math functions:

1) example of using min() function

min({uni_cpo_width}, {uni_cpo_height})

The result of the function above will be whatever variable has bigger value. For instance, if width equal to 10 and height is equal to 5, than the result will be 10.

1) example of using rangesum() function

rangesum({uni_cpo_start}, {uni_cpo_end}, 1)

The result of the function above will be the sum of numbers with a given step. For instance, if start equal to 5 and end is equal to 7 and step is 1, than the result will be 5+6+7=18. Another example, if start equal to 0 and end is equal to 30 and step is 10, than the result will be 0+10+20+30=60.

Exponentiation