In a filter, a transcluded field/index value is essentially a shortcut for <currentTiddler>get[fieldname]
or <currentTiddler>getindex[indexname]
. So you could define an equivalent procedure like this:
\procedure scaled-nutrient(nutrient)
<$text text={{{ [<currentTiddler>getindex<nutrient>divide<ref-qty>multiply<cur-qty>precision[3]] }}}/>
\end
In this particular case, since the only content of your macro/procedure is a text widget, I’d actually recommend using a function instead. Functions are specifically designed to return the plain text result of a filter, so you can eliminate the text widget. Try this:
\function scaled-nutrient(nutrient)
[<currentTiddler>getindex<nutrient>divide<ref-qty>multiply<cur-qty>precision[3]]
\end
You can use the function the same way you’d use the corresponding macro: <<scaled-nutrient nutrientName>>