Skip to content

Commit

Permalink
[RM] v1.0.5 upd
Browse files Browse the repository at this point in the history
  • Loading branch information
dractw committed Aug 30, 2019
1 parent e4834b8 commit f5013db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,26 @@ import { toMinimal, fromMinimal, formatted } from 'ccunits'
Format input number by cryptocurrency decimal precision
```js
const formatted = require('ccunits').formatted;
OR
import { formatted } from 'ccunits'

formatted('0.6789853354', 5) // '0.67898'
```

Convert to minimal unit
```js
const toMinimal = require('ccunits').toMinimal
OR
import { toMinimal } from 'ccunits'

toMinimal('0.0066752', 18) // '6675200000000000'
```

Convert from minimal unit
```js
const fromMinimal = require('ccunits').fromMinimal
OR
import { fromMinimal } from 'ccunits'

fromMinimal('100546675200000000', 18) // '0.1005466752'
```
Expand Down

0 comments on commit f5013db

Please sign in to comment.