export const formatAmount = (amount: number): string => {
  if (amount >= 1000000) {
    return `${amount / 1000000}m`
  } else if (amount >= 10000) {
    return `${amount / 1000}k`
  } else if (amount >= 1000) {
    return `${amount / 1000}k`
  } else {
    return amount.toString()
  }
}
export const formatAmountNoFloat = (number: number): string => {
  const absNumber = Math.abs(number)
  if (absNumber >= 1e6) {
    return (number / 1e6).toFixed(1).replace(/\.0$/, '') + 'm'
  } else if (absNumber >= 1e3) {
    return (number / 1e3).toFixed(1).replace(/\.0$/, '') + 'k'
  } else {
    return number.toString().replace(/(\.\d*?[1-9])0+$|\.0*$/, '$1')
  }
}
