summaryrefslogtreecommitdiffhomepage
path: root/app/lib/formatters.js
blob: 89d45d44a024fefbfee6e30f3f676f77bb593933 (plain)
1
2
3
4
5
6
7
8
9
// @flow
export const formatAccount = (val: string): string => {
  // display number altogether when longer than 12
  if(val.length > 12) {
    return val;
  }
  // display quartets
  return val.replace(/([0-9]{4})/g, '$1 ').trim();
};