returns formatting function
config | object | an object of formatting configuration options |
function | the formatting function |
//a single datatable column
columns:[
{
id:"votes",
format:webix.Number.numToStr({
groupDelimiter:" ",
groupSize:3,
decimalDelimiter:",",
decimalSize:2
})
}
]
The config object can contain the following attributes:
const formatFunc = webix.Number.numToStr({ decimalOptional: true, decimalDelimiter:","});
formatFunc(10000.9990);
// ->10000,999
const formatNegative = webix.Number.numToStr({
groupDelimiter:" ",
groupSize:3,
decimalDelimiter:",",
decimalSize:2,
minusPosition:"parentheses",
minusSign:"()",
})
(formatNegative(-540997.848))
// -> (540 997,85)
The method doesn't format number, but returns a function which can be used for formatting