I am getting two numbers from a previous node and need to send the smaller via HTTPS node. I am trying to use the function $min() with 2 arguments. When I try with 2 numbers, it works, but not with 2 variables:
{{ min(5,4) }} returns 4 as expected,
but
{{ $min( {{ $(‘Split In Batches’).item.json[“total_currency_balance”]}},{{ $(‘Split In Batches’).item.json[“currency_expiring”] }} ) }} returns invalid syntax
In this example, it returns the value “27.5”, which is correct.
However, i need to send “27,50” in the next node (currency format outside US, with comma instead of period and 2 decimals).
I tried to insert .toFloat().toFixed(2).replace(“.”,‘,’), which works outside the $min(), but returns null here:
{{ $min($(‘Split In Batches’).item.json[“total_currency_balance”].toFloat().toFixed(2).replace(“.”,‘,’)
, $(‘Split In Batches’).item.json[“currency_expiring”].toFloat().toFixed(2).replace(“.”,‘,’) ) }}