function toExponential (value, precision) {
  if (isNaN(value) || !isFinite(value)) {
    return String(value)
  }

  // round if needed, else create a clone
  const split = splitNumber(value)
  const rounded = precision ? roundDigits(split, precision) : split
  let c = rounded.coefficients
  const e = rounded.exponent

  // append zeros if needed
  if (c.length < precision) {
    c = c.concat(zeros(precision - c.length))
  }

  // format as `C.CCCe+EEE` or `C.CCCe-EEE`
  const first = c.shift()
  return rounded.sign + first + (c.length > 0 ? ('.' + c.join('')) : '') +
    'e' + (e >= 0 ? '+' : '') + e
}
Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3'
@param {number | string} value
@param {number} [precision]  Number of digits in formatted output.
                             If not provided, the maximum available digits
                             is used.