This topic has not yet been rated - Rate this topic

decRound Function

Rounds a number to the specified number of decimal places.


real decRound(real figure, int decimals)

Parameter

Description

figure

The number to round.

decimals

The number of decimal places to round to.

The value of the specified number, rounded to the specified number of decimal places.

The value of the decimals parameter can be positive, zero, or negative.

  • decRound(1234.6574,2); //Returns the value 1234.66.

  • decRound(1234.6574,0); //Returns the value 1235.

  • decRound(1234.6574,-2); //Returns the value 1200.

  • decRound(12345.6789,1) //Returns the value 12345.70.

  • decRound(12345.6789,-1) //Returns the value 12350.00.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ