public/javascripts/vendor/javascripts/geolib.js
function(value) {

			value = value.toString().replace(/\s*/, '');

			// looks silly but works as expected
			// checks if value is in decimal format
			if (!isNaN(parseFloat(value)) && parseFloat(value).toString() == value) {    
				return parseFloat(value);
			// checks if it's sexagesimal format (HHH° MM' SS" (NESW))
			} else if(geolib.isSexagesimal(value) == true) {
				return parseFloat(geolib.sexagesimal2decimal(value));
			} else {
				throw 'Unknown format.';
			}

		}
function(value) {

			value = value.toString().replace(/\s*/, '');

			// looks silly but works as expected
			// checks if value is in decimal format
			if (!isNaN(parseFloat(value)) && parseFloat(value).toString() == value) {    
				return parseFloat(value);
			// checks if it's sexagesimal format (HHH° MM' SS" (NESW))
			} else if(geolib.isSexagesimal(value) == true) {
				return parseFloat(geolib.sexagesimal2decimal(value));
			} else {
				throw 'Unknown format.';
			}

		}
function ( value ) { value = value . toString ( ) . replace ( / \s* / , '' ) ; // looks silly but works as expected // checks if value is in decimal format if ( ! isNaN ( parseFloat ( value ) ) && parseFloat ( value ) . toString ( ) == value ) { return parseFloat ( value ) ; // checks if it's sexagesimal format (HHH° MM' SS" (NESW)) } else if ( geolib . isSexagesimal ( value ) == true ) { return parseFloat ( geolib . sexagesimal2decimal ( value ) ) ; } else { throw 'Unknown format.' ; } }
Checks if a value is in decimal format or, if neccessary, converts to decimal

@param		mixed		Value to be checked/converted
@return		float		Coordinate in decimal format
Checks if a value is in decimal format or if neccessary converts to decimal