incorporate review by @marcjansen

This commit is contained in:
Bart van den Eijnden
2012-03-21 12:17:44 +01:00
parent 94bd37031d
commit 430d09eb55
3 changed files with 20 additions and 8 deletions

View File

@@ -196,10 +196,11 @@ OpenLayers.String = {
* otherwise.
*/
numericIf: function(value, trimWhitespace) {
var originalValue = value;
if (trimWhitespace === true) {
value = value.replace(/^\s*|\s*$/g, "");
}
return OpenLayers.String.isNumeric(value) ? parseFloat(value) : value;
return OpenLayers.String.isNumeric(value) ? parseFloat(value) : originalValue;
}
};