How can I control the formatting of numbers in Jade template?
Sample code:
for item in issue.item
tr
td.utilityValue #{item.$.value}
td.utilityUtil #{item.$.evaluation * utilitySpace.weightmultiplyer}
I want the numbers to print with 2 significant digits.
Here is the solution I found; it works for Express 3:
Install sprintf by issuing:
In app.js:
In template.jade:
……
td.utility #{sprintf(format, value)}
……