I have this code in a plugin that finds the value of a list XPs and uses a filter to sum the values:
<h2>Total XP:
<$calc>
<$set name="count" filter="[enlist:raw{!!creatures}count[]]">
<$list filter="[range<count>]" variable="i">
<$list filter="[enlist:raw{!!creatures}nth<i>]">
{{!!xp}} +
</$list>
</$list>
</$set>
0
</$calc>
</h2>
This is now causing an error with the updated source tiddlers because the new XP fields are now using commas in the numbers. E.g. 1500 is now 1,500. The filter is giving an unable to parse error. I want to add a search-replace operator to the reference to !!xp to remove commas before performing the filter but am having trouble with the syntax required. I’m new to TiddlyWiki and have already spent a few hours reading and playing with syntax but can’t figure it out.Hoping someone can help me.
Obviously this is the incorrect syntax, but I’m hoping to do something like this:
<h2>Total XP:
<$calc>
<$set name="count" filter="[enlist:raw{!!creatures}count[]]">
<$list filter="[range<count>]" variable="i">
<$list filter="[enlist:raw{!!creatures}nth<i>]">
[{{!!xp}}]search-repace[,][] +
</$list>
</$list>
</$set>
0
</$calc>
</h2>