Calculating VAT, applying a discount, rounding an amount to whole currency units, and making sure the discount doesn't exceed a limit — in the Bitrix24 workflow designer this arithmetic takes more time than building the diagram itself. Four Roboteka robots cover the typical calculations as separate actions: a percentage of a number with addition and subtraction, mathematical rounding to N decimal places, always-up or always-down rounding with a step, and comparing two numbers with a pick of the larger and the smaller.

Why is arithmetic a bottleneck in processes?

Formulas in the designer's fields work, but they demand exact syntax and fail silently: the expression returns the wrong value, and the process carries on with the wrong amount. The intermediate result of a formula is logged nowhere — you have to debug blind, plugging values into comments. A robot is a separate action with explicit fields and a result that's visible in the log and written into a process variable or straight into a deal field. One calculation — one action: the diagram can be read and edited by any portal administrator, not just the author of the formula. All four robots below accept numbers with either a dot or a comma as the separator — a value from a field can be passed as is.

How do you calculate a percentage: VAT, discount, markup?

Percentage of a number. Inputs: the number, the percentage, the operation, and the precision — two decimal places by default. There are three operations: of — N% of the number (20% VAT on the amount), add — the number plus N% (markup), subtract — the number minus N% (discount). There are two outputs: the result of the operation and, separately, the value of the percentage itself — handy when you need both the total with the discount and the discount in currency for a notification to the manager. Example: a deal reaches the "Invoice" stage → the robot with the subtract operation computes the amount with a 15% discount → the result is written into the "To pay" field, and the percentage value goes into a comment for the record.

How do you round an amount by the rules of math?

Round a number (to N places) performs ordinary mathematical rounding. Inputs: the number and the number of decimal places, zero by default — to whole numbers. The precision can be negative: −2 rounds to hundreds, turning a price of 14,780 into 14,800. Uses: invoice amounts without small change after computing percentages, planned figures to thousands, standard hours to whole numbers. There's a single output — the rounded value; write it into a numeric deal field or pass it into the next calculation. For money after conversions and discounts this is the last step before writing to the card: otherwise amounts like 12,345.6789 show up on the invoice, confusing both the customer and accounting.

How do you always round up or always round down?

Mathematical rounding doesn't fit when 8.2 boxes have to become nine: short-shipping is worse than an extra package. Round up / down always rounds in the chosen direction. Inputs: the number, the direction up or down, and the rounding step — 1 by default, or 10, 100, or 0.5. Examples: the number of packages by order volume — up to whole numbers; effort in person-days — up in steps of 0.5; a "psychological" price — down to hundreds. A single robot covers units, money, and time alike — only the step and direction change. There's one output — the rounded value, written into a quantity or amount field.

How do you compare two numbers and take the larger?

Compare two numbers (max / min) takes numbers A and B and returns three values at once: the larger, the smaller, and the comparison result — greater, less, or equal. A typical task: a manager's discount mustn't exceed the limit for their role — you take the smaller of the requested discount and the limit and write it into the field, and the dispute is settled automatically without involving a manager. The comparison result is handy for a fork: greater sends the deal to extra approval, equal and less let it through — there's nothing left to compare inside the Condition block, it's enough to check a single word.

Checklist

Percentage, VAT, markup — Percentage of a number; rounding by math — Round a number (to N places); always up or down — Round up / down; the larger and the smaller of two — Compare two numbers. All the math robots are gathered in the math category. Missing an operation? Describe the task — we'll build the robot for free and add it to the catalog.