Friday, August 13, 2021

How to print a number with commas as thousands separators in React Native

  const numberFormat = number => {
    try {
      return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
    } catch (e) {}
  };

No comments:

Post a Comment