Skip to content

Numeral.js

Mathias Rangel Wulff edited this page Jun 13, 2015 · 3 revisions

Formatting Numbers with Numeral.js

You can use Numeral.js library to format numbers in AlaSQL expressions:

    var data = [{a:120000003.456},{a:567234.12}];
    // Pass numeral() function into alasql
    alasql.fn.numeral = numeral;
    // Use numeral() function
    alasql('SELECT numeral(a)->format("0,0") FROM ?',[data]);

See the example in jsFiddle.

Clone this wiki locally