FIX: proper logic for 'noTitle' param of the number helper

This commit is contained in:
Régis Hanol 2016-08-17 23:28:29 +02:00
parent 6d1d7b7c8f
commit dd3d8d85d3

View File

@ -20,11 +20,13 @@ registerUnbound('number', (orig, params) => {
if (params['class']) {
classNames += ' ' + params['class'];
}
let result = "<span class='" + classNames + "'";
let addTitle = params.noTitle ? false : true;
// Round off the thousands to one decimal place
const n = number(orig);
if (n.toString() !== title.toString() && !params.noTitle) {
if (n.toString() !== title.toString() && addTitle) {
result += " title='" + Handlebars.Utils.escapeExpression(title) + "'";
}
result += ">" + n + "</span>";