Round To Decimal Place(s): Difference between revisions

From StarLogo Nova Wiki
(Marked this version for translation)
(updates from Blockument)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
<section begin="image"/>[[File:round_to_decimal_place(s).png|alt=The Round To Decimal Place(s) Block|thumb]]<section end="image"/>
==Usage==


<!--T:2-->
<!--T:2-->
<p id="tooltip">Returns the rounded value of the first input with a specified number of decimal points.</p>
<p id="tooltip">Returns the rounded value of the first input with a specified number of decimal points.</p>
==Syntax==
Inputs in this block:
#a number, to be rounded
#a number, the number of decimal places to be rounded to
==Example==
[[File:round_to_decimal_place(s)_example.gif|alt=Round To Decimal Place(s) example gif|thumb]]
[[File:round_to_decimal_place(s)_example.png|alt=Round To Decimal Place(s) example code|thumb]]
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.


<!--T:1-->
<!--T:1-->

Revision as of 16:55, 14 August 2023

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.