Round

Round ( double number, int numberOfDigits);

Default values:

numberOfDigits: 2

Description

Rounds a number to a certain number of digits.

Input parameters

Parameter Default value Description
number - Defines the number to round.
numberOfDigits 2 Defines the number of digits to which the number is rounded.

Example

plot SMA = Round(Average(close, 12) / TickSize(), 0) * TickSize();

This example script plots 12 period SMA rounded to the nearest tick size value.