Round To Decimal Place(s)/en: Difference between revisions

From StarLogo Nova Wiki
(Updating to match new version of source page)
 
(Updating to match new version of source page)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<languages/>
<languages/>
<section begin="image"/>[[File:round_to_decimal_place(s).png|alt=The Round To Decimal Place(s) Block|thumb]]<section end="image"/>
==Usage==
<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.


[[Category:Math]]
[[Category:Math]]
[[Category:Code Block]]
[[Category:Code Block]]

Latest revision as of 18:36, 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.