import addPeriods from '../helpers/addPeriods' ; example param value const formatToNumber = ( value ) : string => { const [ number , trunc ] = Number ( value ) . toString ( 10 ) . split ( '.' ) ; if ( ! trunc ) return addPeriods ( number ) ; return addPeriods ( number ) + ',' + trunc ; } ; export default formatToNumber ;