getBrowserVersionNumber (XSPUserAgent - JavaScript)

Gets the version of the browser as a number.

* Returns the version number converted as a double. * * This works if the browser has been properly identified by the class. Only * a subset of the browsers are currently reconized. * The number is converted to a double from the string, and every digit located * after the second decimal point is ignored (ex: 3.0.1 becomes 3.0) * * @return the version number, or 0 if not applicable */ public double getBrowserVersionNumber() /**

Syntax

getBrowserVersionNumber() : double
Return value Description
double The version number of the browser, or 0.0.

Usage

If the return value is an empty string, you must analyze XSPUserAgent (JavaScript).

A browser version number is carried only to one decimal position.

To get the version as a string see getBrowserVersion (XSPUserAgent - JavaScript).

Examples

This computed field displays a message depending on the browser version if the browser is IE:
var ua = context.getUserAgent();
if(ua.isIE() && ua.getBrowserVersionNumber() < 7.0) {
	return "You should upgrade your browser. Now running " +
	ua.getBrowser() + " version " + ua.getBrowserVersion();
}