vega-frontend-monorepo/apps/token/src/lib/format-number.ts
Art 2970aae670
fix: included origin of token, moved formatters (#1141)
* fix: included origin of token, moved formatters

* fix: removed title attr, not needed

* fix: added distinction between wallet and contract if they have the same key

* fix: included origin of token, moved formatters

* fix: removed title attr, not needed

* fix: added distinction between wallet and contract if they have the same key
2022-08-30 10:21:27 +02:00

10 lines
297 B
TypeScript

import type { BigNumber } from './bignumber';
import { formatNumber as format } from '@vegaprotocol/react-helpers';
export const formatNumber = (value: BigNumber, decimals?: number) => {
return format(
value,
typeof decimals === 'undefined' ? Math.max(value.dp(), 2) : decimals
);
};