Round To Decimal Place(s)

From StarLogo Nova Wiki
Revision as of 16:55, 14 August 2023 by Admin (talk | contribs) (Marked this version for translation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Other languages:
The Round To Decimal Place(s) Block

Usage

Returns the rounded value of the first input with a specified number of decimal points.

Syntax

Inputs in this block:

  1. a number, to be rounded
  2. a number, the number of decimal places to be rounded to

Example

Round To Decimal Place(s) example gif
Round To Decimal Place(s) example code

In this model, a new random decimal is produced whenever the “Generate Decimal” button is pushed, and that decimal is then rounded to three decimal points whenever the “Round Decimal” button is pushed. This feature is often useful in making data easier to display.