AMF0 Encode Number
@param num
@returns {Buffer}
334975
function amf0encNumber(num) {
    var buf = new Buffer(9);
    buf.writeUInt8(0x00, 0);
    buf.writeDoubleBE(num, 1);
    return buf;
}
512551
function( num ) {
		var n = new Buffer(4);
		if (SAFE) { if (num == 0.0) { }
		else if ((Math.abs(num) < FLOAT32_SMALL) || (num < FLOAT32_NEG) || (num > FLOAT32_POS)) 
			throw new Errors.PackError('Packing float bigger than 32-bits ('+num+')!');
		}
		packViewF32[0] = num;
		for (var i=0; i<4; ++i) n[i]=packViewU8[i];
		return n;
	}
1288165
function pad (num, padLen) {
  var padding = '0000';
  num = String(num);
  return padding.substring(0, padLen - num.length) + num;
}
1249251
function amf0decLongString(buf) {
    var sLen = buf.readUInt32BE(1);
    return { len: 5 + sLen, value: buf.toString('utf8', 5, 5 + sLen) }
}
988018
function num(elem, prop) {
	return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
}
230677
private function _convert_number(&$num)
    {
        if (!empty($this->_params['only_integer']))
            $num = (int)$num;
        else
            $num = (float)$num;
    }
191983
function writeVarInt (buffer, number, offset) {
  varuint.encode(number, buffer, offset);
  return varuint.encode.bytes;
}
22882
protected function decb64($num)
    {
        $bytes = array();
        while($num) {
            array_unshift($bytes, $this->mod($num, 256));
            $num = $this->div($num, 256);
        }
        
        if($bytes && $bytes[0] > 127) {
            array_unshift($bytes,0);
        }
        
        array_unshift($bytes, 'C*');
        
        return base64_encode(call_user_func_array('pack', $bytes));
    }
1094825
function encode(num) {
  var encoded = '';

  do {
    encoded = alphabet[num % length] + encoded;
    num = Math.floor(num / length);
  } while (num > 0);

  return encoded;
}
94835
function commafy (num, options) {
  num = ('' + num).replace(/,/g, '')
  if (num) {
    var opts = baseExports.assign({ spaceNumber: 3, separator: ',' }, options)
    var optFixed = opts.fixed
    var result = (optFixed ? stringToNumber(num).toFixed(optFixed) : num).split('.')
    return result[0].replace(new RegExp('(?=(?!(\\b))(\\d{' + opts.spaceNumber + '})+$)', 'g'), opts.separator) + (result[1] ? '.' + result[1] : '')
  }
  return num
}
1115354
function encodeAMF3Cmd(opt) {
    var data = amf0EncodeOne(opt.cmd);

    if (rtmpCmdDecode[opt.cmd]) {
        rtmpCmdDecode[opt.cmd].forEach(function (n) {
            if (opt.hasOwnProperty(n))
                data = Buffer.concat([data, amf3EncodeOne(opt[n])]);
        });
    } else {
        console.log('Unknown command', opt);
    }
    return data
}
582973
function ToInteger(num) {
        var n = +num;
        if (isActualNaN(n)) {
            n = 0;
        } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
            n = (n > 0 || -1) * Math.floor(Math.abs(n));
        }
        return n;
    }
614292
function amf0encUString(s) {
    var data = new Buffer(s,'utf8');
    var sLen = new Buffer(2);
    sLen.writeUInt16BE(data.length,0);
    return Buffer.concat([sLen,data]);
}
517027
function numToDigits(num) {
	var digits = num.toString().split('');
	for (var i = 0; i < digits.length; i++) {
		digits[i] = +digits[i];
	}
	digits.reverse();
	return digits;
}
423216
function NUM() {
        var _parser = SEQ(OPT('-'), OR('0', SEQ(RANGE('1', '9'), REPEAT(DIGIT()))), OPT(SEQ('.', REPEAT(DIGIT(), 1))), OPT(SEQ(OR('e', 'E'), OPT(OR('+', '-')), REPEAT(DIGIT(), 1))));

        return _make_alias('NUM', paka.P.NUM, _parser);
    }
150079
function amf0decString(buf) {
    var sLen = buf.readUInt16BE(1);
    return { len: 3 + sLen, value: buf.toString('utf8', 3, 3 + sLen) }
}
946794
private static function utf8($num) {
    if ($num <=     0x7F) return chr($num);
    if ($num <=    0x7FF) return chr(($num >>  6) + 192) . chr(( $num        & 63) + 128);
    if ($num <=   0xFFFF) return chr(($num >> 12) + 224) . chr((($num >>  6) & 63) + 128) . chr(( $num       & 63) + 128);
    if ($num <= 0x1FFFFF) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
    return '';
  }