code: function numToIndexableString(num) {
  
    if (num === 0) {
      return '1';
    }
  
    // convert number to exponential format for easier and
    // more succinct string sorting
    var expFormat = num.toExponential().split(/e\+?/);
    var magnitude = parseInt(expFormat[1], 10);
  
    var neg = num < 0;
  
    var result = neg ? '0' : '2';
  
    // first sort by magnitude
    // it's easier if all magnitudes are positive
    var magForComparison = ((neg ? -magnitude : magnitude) - MIN_MAGNITUDE);
    var magString = padLeft((magForComparison).toString(), '0', MAGNITUDE_DIGITS);
  
    result += SEP + magString;
  
    // then sort by the factor
    var factor = Math.abs(parseFloat(expFormat[0])); // [1..10)
    /* istanbul ignore next */
    if (neg) { // for negative reverse ordering
      factor = 10 - factor;
    }
  
    var factorStr = factor.toFixed(20);
  
    // strip zeros from the end
    factorStr = factorStr.replace(/\.?0+$/, '');
  
    result += SEP + factorStr;
  
    return result;
  }
docs: conversion: x yyy zz...zz x = 0 for negative, 1 for 0, 2 for positive y = exponent (for negative numbers negated) moved so that it's >= 0 z = mantisse