Skip to main content link. Accesskey S

The useful resource for IBM Lotus Domino XPages development

Submit Search

Available in the Appstore!All the content of xpageswiki.com for iPhone or iPad for offline access.

Home > Server JavaScript > Work with numbers / math

Work with numbers / math

ShowTable of Contents

Convert a string to a number


var s = new Number(n)

Round to n decimals


You can round a number with
Math.round(number)


Rounding to for example 3 decimals:

Math.round(number * 1000) / 1000

Integer division


Math.floor(number / 2)


Returns only the integer part of a division.

Formattet output


Use the I18n.toString() method to format numbers, for example:

var b = 12.3453,42;
I18n.toString(n);

Add Comment

Name:
Comments:
Use  searchlotus.com  for news in the Web related to Lotus Notes and Domino,
and to search those sites.
Check  youatnotes.com  for great Lotus Notes, Domino and XPages software.
Did this information help you?
Please honor our efforts and flattr this!