Skip to content

Commit 0e42bc4

Browse files
committed
chore: add docs
1 parent 3a11952 commit 0e42bc4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/typink/src/utils/formatBalance.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,22 @@ export interface FormatBalanceOptions {
55
symbol?: string;
66
}
77

8+
// More specific information for the function
9+
10+
/**
11+
* Format a balance value to a human-readable string.
12+
*
13+
* @param value - The balance value.
14+
* @param options - The formatting options.
15+
* @param options.decimals - The decimals of network.
16+
* @param options.symbol - The currency symbol.
17+
*
18+
* @returns The formatted balance.
19+
*/
820
export function formatBalance(value: number | bigint | string | undefined, options: FormatBalanceOptions): string {
921
if (value === undefined) {
1022
return '';
11-
}
23+
}
1224

1325
const { decimals = 0, symbol } = options;
1426

0 commit comments

Comments
 (0)