BigDecimal
open class BigDecimal : ObjectBase, @unchecked Sendable
extension BigDecimal: Equatable, Comparable
Arbitrary precision decimal value.
-
Initialize from an integer value.
Declaration
Swift
public convenience init(_ value: Int)Parameters
valueInteger value.
-
Declaration
Swift
public func decimalValue() -> Decimal -
Initialize from a decimal value.
Declaration
Swift
public convenience init(_ value: Decimal)Parameters
valueDecimal value.
-
Initialize from a string value.
Declaration
Swift
public convenience init(_ text: String)Parameters
textString value. Must use valid XML Schema lexical representation for type
decimal. -
Undocumented
Declaration
Swift
public static let roundNone: Int -
Undocumented
Declaration
Swift
public static let roundDown: Int -
Undocumented
Declaration
Swift
public static let roundEven: Int -
Undocumented
Declaration
Swift
public static let roundUp: Int -
Declaration
Swift
public final func abs() -> BigDecimalReturn Value
The absolute value of this value (0 for zero, otherwise positive).
-
Declaration
Swift
public final func add(_ p_y: BigDecimal) -> BigDecimalReturn Value
The sum of this value and another value.
-
Declaration
Swift
public final func byteValue() -> IntReturn Value
This value converted to type `byte’.
-
Declaration
Swift
public final func ceiling() -> BigDecimalReturn Value
This value rounded up to the nearest integer value.
-
Declaration
Swift
public final func compareTo(_ p_y: BigDecimal) -> IntReturn Value
This value compared to another value (-1 if
this < other, 0 ifthis == other, 1 ifthis > other). -
Declaration
Swift
public final func divide(_ p_y: BigDecimal) -> BigDecimalReturn Value
This value divided by another value.
-
Declaration
Swift
public final func doubleValue() -> DoubleReturn Value
This value converted to type `double’.
-
Declaration
Swift
public final func equalTo(_ y: BigDecimal) -> BoolReturn Value
trueif this value is equal to another value. -
Declaration
Swift
public final func floatValue() -> FloatReturn Value
This value converted to type `float’.
-
Declaration
Swift
public final func floor() -> BigDecimalReturn Value
This value rounded down to the nearest integer value.
-
Declaration
Swift
open class func fromByte(_ value: Int) -> BigDecimalParameters
valueByte value.
Return Value
valueconverted from typebyte. -
Declaration
Swift
open class func fromDouble(_ value: Double) -> BigDecimalParameters
valueDouble value.
Return Value
valueconverted from typedouble. -
Declaration
Swift
open class func fromFloat(_ value: Float) -> BigDecimalParameters
valueFloat value.
Return Value
valueconverted from typefloat. -
Declaration
Swift
open class func fromInt(_ value: Int) -> BigDecimalParameters
valueInt value.
Return Value
valueconverted from typeint. -
Declaration
Swift
open class func fromLong(_ value: Int64) -> BigDecimalParameters
valueLong value.
Return Value
valueconverted from typelong. -
Declaration
Swift
open class func fromShort(_ value: Int) -> BigDecimalParameters
valueShort value.
Return Value
valueconverted from typeshort. -
Declaration
Swift
public final func greaterEqual(_ y: BigDecimal) -> BoolReturn Value
trueif this value is greater than or equal to another value. -
Declaration
Swift
public final func greaterThan(_ y: BigDecimal) -> BoolReturn Value
trueif this value is greater than another value. -
Declaration
Swift
public final func intValue() -> IntReturn Value
This value converted to type `int’.
-
Declaration
Swift
public final func lessEqual(_ y: BigDecimal) -> BoolReturn Value
trueif this value is less than or equal to another value. -
Declaration
Swift
public final func lessThan(_ y: BigDecimal) -> BoolReturn Value
trueif this value is less than another value. -
Declaration
Swift
open class func literal(_ text: String) -> BigDecimalParameters
textText string using XML Schema lexical representation for this type.
Return Value
valueparsed fromtextin XML Schema lexical form. Throws an exception if the value is invalid. -
Declaration
Swift
public final func longValue() -> Int64Return Value
This value converted to type `long’.
-
Declaration
Swift
public final func multiply(_ p_y: BigDecimal) -> BigDecimalReturn Value
The product of this value and another value.
-
Declaration
Swift
public final func negate() -> BigDecimalReturn Value
The negation of this value.
-
Declaration
Swift
public final func notEqual(_ y: BigDecimal) -> BoolReturn Value
trueif this value is not equal to another value. -
Declaration
Swift
open class func parse(_ text: String) -> BigDecimal?Parameters
textText string using XML Schema lexical representation for this type.
Return Value
valueparsed fromtextin XML Schema lexical form, orniliftextis not in that form. -
Declaration
Swift
public final func remainder(_ y: BigDecimal) -> BigDecimalReturn Value
The remainder of this value divided by another value.
-
Declaration
Swift
public final func round(_ scale: Int = (0 as Int)) -> BigDecimalReturn Value
This value rounded to the specified scale (number of digits to the right of the decimnal point).
-
Declaration
Swift
public final func scale() -> IntReturn Value
The scale of this value (number of places to the right of the decimal point).
-
Declaration
Swift
public final func shortValue() -> IntReturn Value
This value converted to type `short’.
-
Declaration
Swift
public final func sign() -> IntReturn Value
The sign of this value (-1 for negative, 0 for zero, 1 for positive).
-
Declaration
Swift
public final func subtract(_ p_y: BigDecimal) -> BigDecimalReturn Value
The difference between this value and another value.
-
Declaration
Swift
override public final func toString() -> StringReturn Value
String representation of this value (using XML Schema canonical form).
-
Declaration
Swift
public final func truncate() -> BigDecimalReturn Value
This value with fraction truncated.