File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,11 @@ const limitNum = (n: bigint, d = 18): bigint => {
6868 }
6969} ;
7070
71- export function toHumanFormat ( num : bigint , precision = 2 ) : string {
71+ function toHumanFormat ( num : bigint , precision = 2 ) : string {
72+ if ( num >= BigInt ( 1e18 ) ) {
73+ return `${ formatBn4dig ( num / BigInt ( 1e12 ) , precision ) } T` ;
74+ }
75+
7276 if ( num >= BigInt ( 1e15 ) ) {
7377 return `${ formatBn4dig ( num / BigInt ( 1e9 ) , precision ) } Bn` ;
7478 }
@@ -84,7 +88,7 @@ export function toHumanFormat(num: bigint, precision = 2): string {
8488 return formatBn4dig ( num , precision ) ;
8589}
8690
87- export function formatBn4dig ( num : bigint , precision = 2 ) : string {
91+ function formatBn4dig ( num : bigint , precision = 2 ) : string {
8892 if ( precision > 6 ) {
8993 throw new Error ( "Precision is too high, try <= 6" ) ;
9094 }
You can’t perform that action at this time.
0 commit comments