# Class Currency

Currency represents a local currency amount that can be formatted using the `Intl` apis.

## Properties

PRECISION: number = 20

## Accessors

• get precision(): number
• #### Returns number

• set precision(value: number): void

## Methods

• Returns a new `Decimal` that is the sum of this and `x`.

### Example

``````let a = decimal('50000000000')let b = decimal('0.000000005')a.add(b)  // 50000000000.000000005
``````

### Returns

#### Returns Currency

• Returns a new copy of this Decimal value.

#### Returns Currency

• Returns a comparison value representing the ordering of this value in respect to `x`.

• `-1` if this < x
• `1` if this > x
• `0` if this == x

### Returns

#### Returns 1 | -1 | 0

• Returns a new `Decimal` that is the quotient of this and `x`

### Example

``````let a = decimal('1')let b = decimal('3')a.div(b)  // 0.333333333333333333333333333333
``````

### Returns

#### Returns Currency

• Returns `true` if this value is equal to the value of `x`, otherwise `false`.

### Returns

other

#### Returns string

• Returns `true` if this value is greater than the value of `x`, otherwise `false`.

### Returns

#### Returns boolean

• Returns `true` if this value is greater than or equal to the value of `x`, otherwise `false`.

### Returns

#### Returns boolean

• Returns `true` if this value is less than the value of `x`, otherwise `false`.

### Returns

#### Returns boolean

• Returns `true` if this value is less than or equal to the value of `x`, otherwise `false`.

### Returns

#### Returns boolean

• Returns a new `Decimal` that is the product of this and `x`.

### Example

``````let a = decimal('0.0000000000000000000025')let b = decimal('400000000000000000000')a.mul(b)  // 1
``````

### Returns

#### Returns Currency

• Returns a new `Decimal` that has the opposite sign of this `Decimal`.

### Example

``````let a = decimal('5')a.negated()  // -5
``````

### Returns

#### Returns string

• Returns a new `Decimal` that is the difference between this and `x`.

### Example

``````let a = decimal('1')let b = decimal('0.0000000000000000001')a.sub(b)  // 0.9999999999999999999
``````

### Returns

#### Returns Currency

• Converts this decimal to the `Number` value

### Returns

#### Returns number

• Returns a string representation of this decimal.

### Returns

#### Returns string

Generated using TypeDoc