module.exports = function parseUnit(str, out) { if (!out) out = [ 0, '' ] str = String(str) var num = parseFloat(str, 10) out[0] = num out[1] = str.match(/[\d.\-\+]*\s*(.*)/)[1] || '' return out }