Adds useful methods to the JavaScript Number type.
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/core/Number.js')
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/core/Number.js')
Methods
format a Number to a String
parameters
String | Format pattern | |
java.util.Locale | An optional Locale instance |
returns
String Number formatted to a String |
return the percentage of a Number
according to a given total Number
parameters
Int | Total | |
String | Format Pattern | |
java.util.Locale | An optional Locale instance |
returns
Int Percentage |
factory to create functions for sorting objects in an array
parameters
String | name of the field each object is compared with | |
Number | order (ascending or descending) |
returns
Function ready for use in Array.prototype.sort |