File tree 1 file changed +5
-5
lines changed
packages/plugin-starknet/src/utils
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,11 @@ export const getPercent = (amount: string | number, decimals: number) => {
38
38
return new Percent ( amount , decimals ) ;
39
39
} ;
40
40
41
- export const parseFormatedAmount = ( amount : string ) => amount . replace ( / , / g, "" ) ;
41
+ export const parseFormattedAmount = ( amount : string ) => amount . replace ( / , / g, "" ) ;
42
42
43
43
export const PERCENTAGE_INPUT_PRECISION = 2 ;
44
44
45
- export const parseFormatedPercentage = ( percent : string ) =>
45
+ export const parseFormattedPercentage = ( percent : string ) =>
46
46
new Percent (
47
47
+ percent * 10 ** PERCENTAGE_INPUT_PRECISION ,
48
48
100 * 10 ** PERCENTAGE_INPUT_PRECISION
@@ -65,12 +65,12 @@ export const formatCurrenyAmount = (
65
65
} ;
66
66
67
67
export const formatPercentage = ( percentage : Percent ) => {
68
- const formatedPercentage = + percentage . toFixed ( 2 ) ;
68
+ const formattedPercentage = + percentage . toFixed ( 2 ) ;
69
69
const exact = percentage . equalTo (
70
- new Percent ( Math . round ( formatedPercentage * 100 ) , 10000 )
70
+ new Percent ( Math . round ( formattedPercentage * 100 ) , 10000 )
71
71
) ;
72
72
73
- return `${ exact ? "" : "~" } ${ formatedPercentage } %` ;
73
+ return `${ exact ? "" : "~" } ${ formattedPercentage } %` ;
74
74
} ;
75
75
76
76
export type RetryConfig = {
You can’t perform that action at this time.
0 commit comments