You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The substitute function fails if the number is > 9 i.e 10 20 etc.
fix:
function substitute(stringOrFunction, number) {
var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;
var digits = number.toString(10).split("").map(Number);
var resultnumber = "";
digits.forEach(function (entry) {
var value = ($l.numbers && $l.numbers[entry]) || number;
if (value === number) {
resultnumber = value;
} else {
resultnumber += value;
}
});
return string.replace(/%d/gi, resultnumber);
}
The text was updated successfully, but these errors were encountered:
The substitute function fails if the number is > 9 i.e 10 20 etc.
fix:
function substitute(stringOrFunction, number) {
var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;
var digits = number.toString(10).split("").map(Number);
var resultnumber = "";
digits.forEach(function (entry) {
var value = ($l.numbers && $l.numbers[entry]) || number;
if (value === number) {
resultnumber = value;
} else {
resultnumber += value;
}
});
return string.replace(/%d/gi, resultnumber);
}
The text was updated successfully, but these errors were encountered: