param { int } val param { int } decimals return { string | null } export function numFormat ( val , dec ) { if ( ! isNaN ( val ) ) return val . toLocaleString ( 'en-US' , { maximumFractionDigits : dec } ) ; else return null ; } param { int } val param { int } decimals return { string | null } export function assetFormat ( val , dec ) { const decimals = dec || 0 ; const amount = val / Math . pow ( 10 , decimals ) ; return numFormat ( amount , decimals ) ; }