export const toThousands = (num) => {
  if (num === undefined) {
    num = '0'
  } else if (Object.prototype.toString.call(num) === '[object Number]') {
    num = num.toString()
  }
  return num.replace(/(\d)(?=(\d{3})+$)/g, '$1,')
}
