SIGN IN SIGN UP

Login to your account

Username or Email *
Password *
Remember Me
Apex Beginner Progress | ( Lessons)

Lesson: 08 | Decimal Methods


round():

Returns the rounded approximation of this Decimal. The number is rounded to zero decimal places using half-even rounding mode, that is, it rounds towards the “nearest neighbor” unless both neighbors are equidistant, in which case, this mode rounds towards the even neighbor.


scale():

Returns the scale of the Decimal, that is, the number of decimal places.


intValue():

Returns the Integer value of this Decimal.


format():

Returns the String value of this Decimal using the locale of the context user.


abs():

Returns the absolute value of the Decimal.


setScale():

Returns the Decimal scaled to the specified number of decimal places, using half-even rounding, if necessary. Half-even rounding mode rounds toward the “nearest neighbor.” If both neighbors are equidistant, the number is rounded toward the even neighbor.

valueOf():

Type 1: Returns a Decimal that contains the value of the specified String.

Type 2: Returns a Decimal that contains the value of the specified Long.

Type 3: Returns a Decimal that contains the value of the specified Double.

 


Prev You need to login to have access to the quizzes. Next

Mastered by 206 users.

Apex Beginner

A. Apex Fundamentals (23 lessons)
B. Apex Collections (6 lessons)
Go to top