Fork me on GitHub

Module core/number

Adds useful methods to the JS Number type.

Class Number

Instance Methods


Number.prototype.format (fmt, locale)

Format a number using java.text.DecimalFormat.

Parameters

fmt the format to apply
locale optional locale

Returns

the number formatted as string

Number.prototype.times (fun)

Invoke a function this times, passing 0 .. this - 1 as argument.

Parameters

Function fun the function to call