Files
common/packages/util/src/format/formatNumber.ts
T
Jaco f2d611e26d BN util export (& imports adjust) (#1009)
* BN util export (& imports adjust)

* Fix hexToBn

* Adjusts test

* Move bn export
2021-06-11 11:42:29 +02:00

13 lines
425 B
TypeScript

// Copyright 2017-2021 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { BN } from '../bn/bn';
import type { ToBn } from '../types';
import { bnToBn } from '../bn/toBn';
import { formatDecimal } from './formatDecimal';
export function formatNumber <ExtToBn extends ToBn> (value?: ExtToBn | BN | BigInt | number | null): string {
return formatDecimal(bnToBn(value).toString());
}