Rounding formula results

If you have set the program to perform calculations with a certain precision — for example, 2, 3, 4 digits after the decimal point — but do not need the results displayed in fractional format in print drawings, you can use formulas for rounding the calculation results. Note that if you have set the program to process numbers with no display precision, the use of these formulas is meaningless, because the calculation results are rounded automatically.

NOTE: The following examples use calculation of the length of objects in the Cutting style. OneUpN is the name of the 1up for which calculation is being made.

Formula patterns

TO ROUND THE FORMULA RESULT

USE

According to the standard rounding rules — for example, 23.44 becomes 23.00; 23.45 becomes 24.00

$round(OneUpN.Length(Cutting; mm)$

Up to the next integer — 23.01 becomes 24.00

$roundup(OneUpN.Length(Cutting; mm)$ or $ceil(OneUpN.Length(Cutting; mm)$

Down to the previous integer — 23.99 becomes 23.00

$rounddown(OneUpN.Length(Cutting; mm)$ OR $floor(OneUpN.Length(Cutting; mm)$

IMPORTANT: space-separated style names; case-sensitivity; List separator type

SPACE-SEPARATED STYLE NAMES: In a formula, to refer to a style whose name is made up of multiple words separated by spaces, enclose the style name in quotation marks:

$ONEUP1.LENGTH("RILLEN 3PT", m)$

$ONEUP1.LENGTH("RILLEN MIT RILLKÖRPER", m)$

CASE-SENSITIVE INDICATIONS FOR MEASUREMENT UNITS AND FORMATTING: Whenever a formula contains indications for measurement units and formatting, ensure that these are typed in lower case. That is, the formula may be typed in any case you like, but the applied measurement units and formatting indications must be typed in lower case. Consider the following examples, in which the formulas are typed in upper case but the measurement and formatting indications are in lower case:

$Layout1.SheetWidth(mm); n2$

$Layout1.lenght(m)$

LIST SEPARATOR TYPE: Throughout this guide, semicolon — (;) — is used to separate formula attributes. List separators are critical for how the program interprets the attributes within formulas. Your own system, however, may use a default list separator that is different from semicolon — for example, comma (,). In this case, if you simply copy a formula from the help guide and then paste it, error messages will appear and the formula will not calculate.

So while typing a formula, ensure that the list separator used in the formula is identical with the one set for your system. This means that you may need to edit either your system's list separator setting or the formula you are typing. The examples that follow illustrate how you can use formulas with semicolons and colons as list separators:

As presented in the help guide. list separator is semicolon (;)

type it like this if your list separator is comma (,)

$Layout1.Area(m; Plotting); n2$

$Layout1.Area(m, Plotting), n2$

$Layout1.AreaEx(yes; mm); n2$

$Layout1.AreaEx(yes, mm), n2$

$Layout1.SheetHeight(mm); n2$

$Layout1.SheetHeight(mm), n2$

$Fold3D1.BoundingBoxWidth(Production; mm; yes)$

$Fold3D1.BoundingBoxWidth(Production, mm, yes)$