File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ export function sleep(ms: number): Promise<unknown> {
15
15
*/
16
16
export const shortenNumber = ( amount : number ) => {
17
17
const abreviations = [
18
- { value : 1000000000 , abbreviation : "B" } ,
19
- { value : 1000000 , abbreviation : "M" } ,
20
- { value : 1000 , abbreviation : "K" } ,
18
+ { value : 1000000000 , notation : "B" } ,
19
+ { value : 1000000 , notation : "M" } ,
20
+ { value : 1000 , notation : "K" } ,
21
21
] ;
22
22
23
23
const abbreviation = abreviations . find ( ( { value } ) => amount >= value ) ;
@@ -26,5 +26,5 @@ export const shortenNumber = (amount: number) => {
26
26
27
27
const product = amount / abbreviation . value ;
28
28
const isFloat = product % 1 !== 0 ;
29
- return `${ isFloat ? product . toFixed ( 1 ) : product } ${ abbreviation . abbreviation } ` ;
29
+ return `${ isFloat ? product . toFixed ( 1 ) : product } ${ abbreviation . notation } ` ;
30
30
} ;
You can’t perform that action at this time.
0 commit comments