How to calculate the cost right in the form

← Back

Add a field of type "Calculator" and enter a "Calculation formula" — you can reference other fields in curly braces.

  1. Add a field and select the type "Calculator".
  2. In the "Calculation formula" field, write an expression. Names of other fields are inserted using the buttons in the "Insert field:" row — they are substituted in curly braces: {Print run} * {Price}.
  3. Save. The result recalculates immediately as soon as the visitor changes any field in the formula.

What the formula language can do:

  • arithmetic + - * / ( ), decimals are written with a comma or dot;
  • conditions: If … then … ElseIf … then … Else … EndIf;
  • comparisons = <> < > <= >= and CONTAINS, logic AND, OR, NOT;
  • functions (arguments separated by semicolons): ROUND(x; digits), ROUNDUP, ROUNDDOWN, INT, MIN, MAX, ABS, SQRT, POWER(x; y), COUNT;
  • multiple choice: {Options} CONTAINS "Lamination" and COUNT({Options});
  • comment — two slashes to the end of the line.

The full language reference is in the field window itself, below the formula — "Formula language reference".

If it didn't work

  • The result is empty. Most likely, the formula contains a field that the visitor hasn't filled in yet. Set a "Default value" for such fields.
  • The field name in the formula doesn't work. Insert it with the button, not manually: the name must match the field name letter for letter.
  • You renamed a field — the formula broke. Fix the formula: it references the name.
Did the article help?

See also

Tips for working with the builder

The "Help" section is made for those who are building a website on "Pervaya Liniya" for the first time. It contains answers to common questions: how to create a website, what to write in the fields, how to edit texts and photos, how to connect your own domain, and how to set up sections. The materials will help you figure things out without contacting support.

The builder is simple: you fill in the fields on the creation page, and then edit the content directly on the finished website. If something does not work or is unclear, check the relevant help item. The instructions are written in plain language and describe every step.

In Help you will find answers to questions:

  • how to come up with a website address and what to do if the name is taken;
  • how to change the title, description, and other texts on the page;
  • how to add products, services, or request forms;
  • how to connect your own domain instead of an address on firstline.com.ua;
  • how to set up sections and modules for your business needs.

If you cannot find the answer you need, use the feedback form — we will help you figure it out. The section is updated so that you can always find current information about working with the builder.