# BigDecimal

``open class BigDecimal: ObjectBase``

Arbitrary precision decimal value.

• ``` init(_:) ```

Initialize from an integer value.

#### Declaration

Swift

``public convenience init(_ value: Int)``

#### Parameters

 ``` value ``` Integer value.
• ``` decimalValue() ```

#### Declaration

Swift

``public func decimalValue() -> Decimal``
• ``` init(_:) ```

Initialize from a decimal value.

#### Declaration

Swift

``public convenience init(_ value: Decimal)``

#### Parameters

 ``` value ``` Decimal value.
• ``` init(_:) ```

Initialize from a string value.

#### Declaration

Swift

``public convenience init(_ text: String)``

#### Parameters

 ``` text ``` String value. Must use valid XML Schema lexical representation for type `decimal`.
• ``` roundNone ```

Undocumented

#### Declaration

Swift

``public static let roundNone: Int = (0 as Int)``
• ``` roundDown ```

Undocumented

#### Declaration

Swift

``public static let roundDown: Int = (1 as Int)``
• ``` roundEven ```

Undocumented

#### Declaration

Swift

``public static let roundEven: Int = (2 as Int)``
• ``` roundUp ```

Undocumented

#### Declaration

Swift

``public static let roundUp: Int = (3 as Int)``
• ``` abs() ```

#### Declaration

Swift

``open func abs() -> BigDecimal``

#### Return Value

The absolute value of this value (0 for zero, otherwise positive).

• ``` add(_:) ```

#### Declaration

Swift

``open func add(_ p_y: BigDecimal) -> BigDecimal``

#### Return Value

The sum of this value and another value.

• ``` byteValue() ```

#### Declaration

Swift

``open func byteValue() -> Int``

#### Return Value

This value converted to type `byte’.

• ``` ceiling() ```

#### Declaration

Swift

``open func ceiling() -> BigDecimal``

#### Return Value

This value rounded up to the nearest integer value.

• ``` compareTo(_:) ```

#### Declaration

Swift

``open func compareTo(_ p_y: BigDecimal) -> Int``

#### Return Value

This value compared to another value (-1 if `this < other`, 0 if `this == other`, 1 if `this > other`).

• ``` divide(_:) ```

#### Declaration

Swift

``open func divide(_ p_y: BigDecimal) -> BigDecimal``

#### Return Value

This value divided by another value.

• ``` doubleValue() ```

#### Declaration

Swift

``open func doubleValue() -> Double``

#### Return Value

This value converted to type `double’.

• ``` equalTo(_:) ```

#### Declaration

Swift

``open func equalTo(_ y: BigDecimal) -> Bool``

#### Return Value

`true` if this value is equal to another value.

• ``` floatValue() ```

#### Declaration

Swift

``open func floatValue() -> Float``

#### Return Value

This value converted to type `float’.

• ``` floor() ```

#### Declaration

Swift

``open func floor() -> BigDecimal``

#### Return Value

This value rounded down to the nearest integer value.

• ``` fromByte(_:) ```

#### Declaration

Swift

``open class func fromByte(_ value: Int) -> BigDecimal``

#### Parameters

 ``` value ``` Byte value.

#### Return Value

`value` converted from type `byte`.

• ``` fromDouble(_:) ```

#### Declaration

Swift

``open class func fromDouble(_ value: Double) -> BigDecimal``

#### Parameters

 ``` value ``` Double value.

#### Return Value

`value` converted from type `double`.

• ``` fromFloat(_:) ```

#### Declaration

Swift

``open class func fromFloat(_ value: Float) -> BigDecimal``

#### Parameters

 ``` value ``` Float value.

#### Return Value

`value` converted from type `float`.

• ``` fromInt(_:) ```

#### Declaration

Swift

``open class func fromInt(_ value: Int) -> BigDecimal``

#### Parameters

 ``` value ``` Int value.

#### Return Value

`value` converted from type `int`.

• ``` fromLong(_:) ```

#### Declaration

Swift

``open class func fromLong(_ value: Int64) -> BigDecimal``

#### Parameters

 ``` value ``` Long value.

#### Return Value

`value` converted from type `long`.

• ``` fromShort(_:) ```

#### Declaration

Swift

``open class func fromShort(_ value: Int) -> BigDecimal``

#### Parameters

 ``` value ``` Short value.

#### Return Value

`value` converted from type `short`.

• ``` greaterEqual(_:) ```

#### Declaration

Swift

``open func greaterEqual(_ y: BigDecimal) -> Bool``

#### Return Value

`true` if this value is greater than or equal to another value.

• ``` greaterThan(_:) ```

#### Declaration

Swift

``open func greaterThan(_ y: BigDecimal) -> Bool``

#### Return Value

`true` if this value is greater than another value.

• ``` intValue() ```

#### Declaration

Swift

``open func intValue() -> Int``

#### Return Value

This value converted to type `int’.

• ``` lessEqual(_:) ```

#### Declaration

Swift

``open func lessEqual(_ y: BigDecimal) -> Bool``

#### Return Value

`true` if this value is less than or equal to another value.

• ``` lessThan(_:) ```

#### Declaration

Swift

``open func lessThan(_ y: BigDecimal) -> Bool``

#### Return Value

`true` if this value is less than another value.

• ``` longValue() ```

#### Declaration

Swift

``open func longValue() -> Int64``

#### Return Value

This value converted to type `long’.

• ``` multiply(_:) ```

#### Declaration

Swift

``open func multiply(_ p_y: BigDecimal) -> BigDecimal``

#### Return Value

The product of this value and another value.

• ``` negate() ```

#### Declaration

Swift

``open func negate() -> BigDecimal``

#### Return Value

The negation of this value.

• ``` notEqual(_:) ```

#### Declaration

Swift

``open func notEqual(_ y: BigDecimal) -> Bool``

#### Return Value

`true` if this value is not equal to another value.

• ``` parse(_:) ```

#### Declaration

Swift

``open class func parse(_ text: String) -> BigDecimal?``

#### Parameters

 ``` text ``` Text string using XML Schema lexical representation for this type.

#### Return Value

`value` parsed from `text` in XML Schema lexical form, or `nil` if `text` is not in that form.

• ``` remainder(_:) ```

#### Declaration

Swift

``open func remainder(_ y: BigDecimal) -> BigDecimal``

#### Return Value

The remainder of this value divided by another value.

• ``` round(_:) ```

#### Declaration

Swift

``open func round(_ scale: Int = (0 as Int)) -> BigDecimal``

#### Return Value

This value rounded to the specified scale (number of digits to the right of the decimnal point).

• ``` scale() ```

#### Declaration

Swift

``open func scale() -> Int``

#### Return Value

The scale of this value (number of places to the right of the decimal point).

• ``` shortValue() ```

#### Declaration

Swift

``open func shortValue() -> Int``

#### Return Value

This value converted to type `short’.

• ``` sign() ```

#### Declaration

Swift

``open func sign() -> Int``

#### Return Value

The sign of this value (-1 for negative, 0 for zero, 1 for positive).

• ``` subtract(_:) ```

#### Declaration

Swift

``open func subtract(_ p_y: BigDecimal) -> BigDecimal``

#### Return Value

The difference between this value and another value.

• ``` toString() ```

#### Declaration

Swift

``override open func toString() -> String``

#### Return Value

String representation of this value (using XML Schema canonical form).

• ``` truncate() ```

#### Declaration

Swift

``open func truncate() -> BigDecimal``

#### Return Value

This value with fraction truncated.