import integer from './core/integer'
import fractional from './core/fractional'

export const numpad = function (num: number, padlen: number, padstr: string = '0', toFixed: number | false = false) {
  const minus = num < 0 ? '-' : ''
  const intePart = integer(num, padlen, padstr, toFixed)
  const fracPart = fractional(num, toFixed)

  return minus + intePart + fracPart
}
