Open robert-m opened 3 years ago
@robert-m Did you find any existing Handlebars scripts (JS) that support this?
@Timo-Breumelhof I haven't looked into it too much, but from my preliminary research I found this as a possible starting point. https://github.com/mrhanlon/handlebars-math-helper
Another way to get this implemented would be to use Handlebars Subexpressions? https://handlebarsjs.com/guide/expressions.html#subexpressions
The current maths expression helpers are very limiting to just 2 numbers. It would be great if we could string together a series of intergers with different operators within the same HB helper to get a value if achievable like the examples below.
Simple Examples Adding
{{math results.game1 + results.game2 + results.game3}}
Adding & Dividing Example 1
{{math results.game1 + results.game2 + results.game3 / 24}}
Adding & Dividing Example 2
{{math results.game1 + results.game2 + results.game3 / @index}}
Adding & Dividing & Multipling Example
{{math results.game1 + results.game2 + results.game3 / 100 * settings.rounds}}