context: dojo.validate.isInRange = function(/*String*/value, /*Object?*/flags){//summary://	Validates whether a string denoting an integer, //	real number, or monetary value is between a max and min. //// value: A string// flags: {max:Number, min:Number, decimal:String}//    flags.max  A number, which the value must be less than or equal to for the validation to be true.//    flags.min  A number, which the value must be greater than or equal to for the validation to be true.//    flags.decimal  The character used for the decimal point.  Default is ".".	//stripping the seperator allows NaN to perform as expected, if no separator, we assume ','	//once i18n support is ready for this, instead of assuming, we default to i18n's recommended value	value = value.replace((dojo.lang.has(flags,'separator'))?flags.separator:',','');	if(isNaN(value)){		return false; // Boolean	}	// assign default values to missing paramters	flags = (typeof flags == "object") ? flags : {};	var max = (typeof flags.max == "number") ? flags.max : Infinity;	var min = (typeof flags.min == "number") ? flags.min : -Infinity;	var dec = (typeof flags.decimal == "string") ? flags.decimal : ".";		// splice out anything not part of a number	var pattern = "[^" + dec + "\\deE+-]";	value = value.replace(RegExp(pattern, "g"), "");	// trim ends of things like e, E, or the decimal character	value = value.replace(/^([+-]?)(\D*)/, "$1");	value = value.replace(/(\D*)$/, "");	// replace decimal with ".". The minus sign '-' could be the decimal!	pattern = "(\\d)[" + dec + "](\\d)";	value = value.replace(RegExp(pattern, "g"), "$1.$2");	value = Number(value);	if ( value < min || value > max ) { return false; } // Boolean	return true; // Boolean}
meta: 4707	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4707/50c3492c4c3c825dbd3401e134a19ed46799c456/common.js/clean/www/resources/dojo-ajax/src/validate/common.js