mars-v2-frontend/utils/formatters.ts
2022-09-14 17:51:14 +01:00

18 lines
377 B
TypeScript

export const formatWalletAddress = (
address: string,
substrLength = 6
): string => {
if (address.length <= 10) {
return address;
}
return `${address.slice(0, substrLength)}...${address.slice(
address.length - substrLength,
address.length
)}`;
};
export const formatCurrency = (value: string | number) => {
return Number(value).toLocaleString();
};