diff --git a/README.md b/README.md index ec3199f..334fe83 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ 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' ``` @@ -24,6 +26,8 @@ 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' ``` @@ -31,6 +35,8 @@ 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' ```