Skip to content
Reference > Classes

BigDecimal

Definition

BigDecimal var = .... ;

Extends

Extended By

None

Description

An unbounded, signed decimal

Method Summary

Owner Name Return Type Description
BigDecimal constructor(value) BigDecimal Initialize a BigDecimal object with a numerical value.
BigDecimal constructor(value) BigDecimal Initialize a BigDecimal object by casting a string to a BigDecimal. String must contain only numerical values.
Object getClassName() String Returns the string name of this object's class type.
Object toJson() String Returns a string of a json representation of this object.

Method Definitions


constructor(value)

BigDecimal bigdecimal = new BigDecimal(Number value)

Description

Initialize a BigDecimal object with a numerical value.

Parameter Definition

Name Type Description
value Number  a big decimal value

Example 1

1
2
3
4
BigDecimal bd = new BigDecimal(1.23456789);

// bd = 1.23456789
// bd.getClassName() = BigDecimal

constructor(value)

BigDecimal bigdecimal = new BigDecimal(String value)

Description

Initialize a BigDecimal object by casting a string to a BigDecimal. String must contain only numerical values.

Parameter Definition

Name Type Description
value String  a big decimal value supplied as a string

Example 1

1
2
3
4
BigDecimal bd = new BigDecimal("1.23456789");

// bd = 1.23456789
// bd.getClassName() = BigDecimal

getClassName()

String Object::getClassName()

Description

Returns the string name of this object's class type.

Example 1

1
2
3
4
BigDecimal bd = new BigDecimal(1.23456789);
bd.getClassName();

// bd.getClassName() = BigDecimal

toJson()

String Object::toJson()

Description

Returns a string of a json representation of this object.

Example 1

1
2
3
4
BigDecimal bd = new BigDecimal(1.23456789);
bd.toJson();

// bd.toJson() = 1.23456789