> For the complete documentation index, see [llms.txt](https://confluxnetwork.gitbook.io/js-conflux-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://confluxnetwork.gitbook.io/js-conflux-sdk/api/drip.md).

# Drip

### Drip

Positive decimal integer string in `Drip`

**Kind**: global class

* [Drip](#Drip)
  * [new Drip(value)](#new_Drip_new)
  * *instance*
    * [.toCFX()](#Drip+toCFX) ⇒ `string`
    * [.toGDrip()](#Drip+toGDrip) ⇒ `string`
  * *static*
    * [.fromCFX(value)](#Drip.fromCFX) ⇒ [`Drip`](#Drip)
    * [.fromGDrip(value)](#Drip.fromGDrip) ⇒ [`Drip`](#Drip)

#### new Drip(value)

| Param | Type                             |
| ----- | -------------------------------- |
| value | `number` \| `string` \| `BigInt` |

**Example**

```js
> new Drip(1.00)
   [String (Drip): '1']
> new Drip('0xab')
   [String (Drip): '171']
```

#### drip.toCFX() ⇒ `string`

Get `CFX` number string

**Kind**: instance method of [`Drip`](#Drip)\
**Example**

```js
> Drip(1e9).toCFX()
   "0.000000001"
```

#### drip.toGDrip() ⇒ `string`

Get `GDrip` number string

**Kind**: instance method of [`Drip`](#Drip)\
**Example**

```js
> Drip(1e9).toGDrip()
   "1"
```

#### Drip.fromCFX(value) ⇒ [`Drip`](#Drip)

Get `Drip` string from `CFX`

**Kind**: static method of [`Drip`](#Drip)

| Param | Type                             |
| ----- | -------------------------------- |
| value | `string` \| `number` \| `BigInt` |

**Example**

```js
> Drip.fromCFX(3.14)
   [String (Drip): '3140000000000000000']
> Drip.fromCFX('0xab')
   [String (Drip): '171000000000000000000']
```

#### Drip.fromGDrip(value) ⇒ [`Drip`](#Drip)

Get `Drip` string from `GDrip`

**Kind**: static method of [`Drip`](#Drip)

| Param | Type                             |
| ----- | -------------------------------- |
| value | `string` \| `number` \| `BigInt` |

**Example**

```js
> Drip.fromGDrip(3.14)
   [String (Drip): '3140000000']
> Drip.fromGDrip('0xab')
   [String (Drip): '171000000000']
```
