You can override the data context property using the template helper method:
Template.myTemplate.helpers({
pctFail: function () { return this.pctFail.toFixed(2); }
})
And then use {{pctFail}}%
as before. If you insist on storing the numerical property as a string, you need to return something like that instead parseFloat(this.pctFail).toFixed(2)
.
source
share