We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a11952 commit 0e42bc4Copy full SHA for 0e42bc4
packages/typink/src/utils/formatBalance.ts
@@ -5,10 +5,22 @@ export interface FormatBalanceOptions {
5
symbol?: string;
6
}
7
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
+ */
20
export function formatBalance(value: number | bigint | string | undefined, options: FormatBalanceOptions): string {
21
if (value === undefined) {
22
return '';
- }
23
+ }
24
25
const { decimals = 0, symbol } = options;
26
0 commit comments