Files
pezkuwi-ui/packages/ui-util/README.md
T
Jaco Greeff 28b991d61d Add documentation on GH pages (#85)
* Add documentation on GH pages

* Expand classes for doc generation

* Update docs

* .nojekyll

* Update Identicon.tsx

* Update Demo.tsx

* Update KeyPair.tsx

* Export specific icons

* Convert tests to TypeScript
2019-02-27 11:18:35 +01:00

24 lines
404 B
Markdown

# @polkadot/ui-util
Various utility and formatting functions
## formatBalance
```js
const props = await api.rpc.system.properties();
formatBalance.setDefaults({
decimals: props.tokenDecimals,
unit: props.tokenSymbol
});
formatBalance('12345'); // 12.345z DOT
```
## calcSi
```js
// calculates the SI unit applicable
formatBalance.calcSi('12345'); // { power: 3, value: 'k', text: 'Kilo' }
```