code: function(str) {
              // determine if the string is a hex number by checking if it begins with '0x' or '-0x', in which case delegate to parseInt with a 16 radix
              if(/^( )*(0x|-0x)/.test(str)) {
                  return parseInt(str, 16);
              }
              // if the number is not in decimal or scientific format, return NaN explicitly instead of letting JavaScript do its loose parsing
              if(!(/^[-+]?[0-9]*[.]?[0-9]*$/.test(str) || (/^[-+]?[0-9][.]?[0-9]*e[-+]?[1-9][0-9]*$/).test(str))) {
                  return NaN;
              }
              return parseFloat(str);
          }
docs: an extended version of parseFloat that will handle numbers encoded in hex format (i.e. "0xff") and is stricter than that native JavaScript parseFloat for decimal numbers