import { abbreviateNumber } from '@app/common/utils' ; export function removeCommas ( amountWithCommas ) { return amountWithCommas . replace ( /,/g , '' ) ; } export function getFormattedAmount ( amount ) { const noCommas = removeCommas ( amount ) ; const number = noCommas . includes ( '.' ) ? parseFloat ( noCommas ) : parseInt ( noCommas ) ; return number > 10000 ? { isAbbreviated : true , value : abbreviateNumber ( number ) , } : { value : amount , isAbbreviated : false } ; }