# Amount

This class defines an Amount for arbitrary-precision decimal arithmetic.

It inherits methods from [big.js](http://mikemcl.github.io/big.js/) library

### Constructor

```ts
new Amount(n): Amount;
```

The Amount constructor.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `n` | `string` \| `number` \| `Amount` | The number, string, or Amount to initialize with |

#### Returns

`Amount`

### abs()

```ts
abs(): Amount;
```

Returns an absolute Amount.

#### Returns

`Amount`

The absolute value as a new Amount

***

### cmp()

```ts
cmp(n): -1 | 0 | 1;
```

Compares this Amount with another value.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `n` | `string` \| `number` \| `Amount` | The value to compare with |

#### Returns

`-1` \| `0` \| `1`

-1 if less than, 0 if equal, 1 if greater than

***

### div()

```ts
div(n): Amount;
```

Divides this Amount by another value.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `n` | `string` \| `number` \| `Amount` | The divisor value |

#### Returns

`Amount`

The division result as a new Amount

***

### eq()

```ts
eq(n): boolean;
```

Checks if this Amount equals another value.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `n` | `string` \| `number` \| `Amount` | The value to compare with |

#### Returns

`boolean`

True if equal, false otherwise

***

### gt()

```ts
gt(n): boolean;
```

Checks if this Amount is greater than another value.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `n` | `string` \| `number` \| `Amount` | The value to compare with |

#### Returns

`boolean`

True if greater than, false otherwise

***

### gte()

```ts
gte(n): boolean;
```

Checks if this Amount is greater than or equal to another value.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `n` | `string` \| `number` \| `Amount` | The value to compare with |

#### Returns

`boolean`

True if greater than or equal, false otherwise

***

### lt()

```ts
lt(n): boolean;
```

Checks if this Amount is less than another value.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `n` | `string` \| `number` \| `Amount` | The value to compare with |

#### Returns

`boolean`

True if less than, false otherwise

***

### lte()

```ts
lte(n): boolean;
```

Checks if this Amount is less than or equal to another value.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `n` | `string` \| `number` \| `Amount` | The value to compare with |

#### Returns

`boolean`

True if less than or equal, false otherwise

***

### minus()

```ts
minus(n): Amount;
```

Subtracts another value from this Amount.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `n` | `string` \| `number` \| `Amount` | The value to subtract |

#### Returns

`Amount`

The difference as a new Amount

***

### mod()

```ts
mod(n): Amount;
```

Calculates the modulo (remainder) of dividing this Amount by another value.

Similar to % operator

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `n` | `string` \| `number` \| `Amount` | The divisor value |

#### Returns

`Amount`

The remainder as a new Amount

***

### plus()

```ts
plus(n): Amount;
```

Adds another value to this Amount.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `n` | `string` \| `number` \| `Amount` | The value to add |

#### Returns

`Amount`

The sum as a new Amount

***

### round()

```ts
round(dp?): Amount;
```

Rounds this Amount to a maximum of dp decimal places.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `dp?` | `number` | The number of decimal places (optional) |

#### Returns

`Amount`

The rounded value as a new Amount

***

### times()

```ts
times(n): Amount;
```

Multiplies this Amount by another value.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `n` | `string` \| `number` \| `Amount` | The value to multiply by |

#### Returns

`Amount`

The product as a new Amount

***

### toFixed()

```ts
toFixed(dp?): string;
```

Returns a string representing the value of this Amount in normal notation to a fixed number of decimal places.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `dp?` | `number` | The number of decimal places (optional) |

#### Returns

`string`

The formatted string representation

***

### toNumber()

```ts
toNumber(): number;
```

Returns a primitive number representing the value of this Amount.

#### Returns

`number`

The numeric value of this Amount

***

### toString()

```ts
toString(): string;
```

Returns a string representing the value of this Amount.

#### Returns

`string`

The string representation of this Amount
