param value param n returns export function truncate ( value , n ) { let i = n ; if ( value . length > i ) { while ( value [ i ] !== " " && -- i > 0 ) { } return `${ value . substring ( 0 , i ) }...` ; } return value ; } param value returns export function round ( value ) { if ( value > 999 ) { const digits = + ( ( value - 950 ) % 1000 > 99 ) ; return `${ ( ( value + 0.000001 ) / 1000 ) . toFixed ( digits ) }k` ; } else { return value . toString ( ) ; } }