Skip to main content link. Accesskey S

The useful resource for IBM Lotus Domino XPages development

Submit Search

Home > Server JavaScript > Work with numbers / math
is maintained by 
Julian Buss.
You can hire me.

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

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;

Add Comment

How to take your XPages App to the iPhone, iPad, Android: use Domino To Go!
Do you look for an XPages Workflow solution? Take YouAtNotes Workflow.