numToStr

returns formatting function

function numToStr(object config);

Parameters

configobjectan object of formatting configuration options

Returns

functionthe formatting function

Example

//a single datatable column
columns:[
    { 
        id:"votes",
        format:webix.Number.numToStr({
            groupDelimiter:" ",
            groupSize:3,
            decimalDelimiter:",",
            decimalSize:2
        })
    }
]

Details

The config object can contain the following attributes:

  • decimalSize - the number of decimal digits in the float number. By default, 2;
  • groupSize - the number of digits in a group. By default, 3;
  • decimalDelimiter - a char which separates the decimal part in the float number. By default, ".";
  • groupDelimiter - a char which separates groups of digits. By default, ",".
var formatFunc = webix.Number.numToStr({ decimalSize:2, decimalDelimiter:","});
 
formatFunc(10000.9990);

The method doesn't format number, but returns a function which can be used for formatting

See also
Back to top