Dashboards utilities
There was once a time when we needed to add libraries as external resources to leverage the process of formatting dates and numbers. Nowadays, it is possible to do the formatting without the need to include external files. We can do the formatting just by including the cfd/dashboard/Utils
module. This will make require
load all the dependencies without any more effort.
Formatting numbers
Numbers can be formatted to look like currency, percentages with decimal places, thousands, and abbreviations. To format numbers, you should use the function numberFormat
, available in the dashboard object. In our examples, you could do this by calling Utils.numberFormat(value[, format[, langCode]])
. The function accepts the arguments; the first ...
Get Learning Pentaho CTools now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.