code: function(value, trimWhitespace) {
          var originalValue = value;
          if (trimWhitespace === true && value != null && value.replace) {
              value = value.replace(/^\s*|\s*$/g, "");
          }
          return OpenLayers.String.isNumeric(value) ? parseFloat(value) : originalValue;
      }
docs: APIFunction: numericIf
  Converts a string that appears to be a numeric value into a number.
  
  Parameters:
  value - {String}
  trimWhitespace - {Boolean}
  
  Returns:
  {Number|String} a Number if the passed value is a number, a String
  otherwise.