Hello,
I’m struggling with what I thought was a simple task, adding together two numbers found in two different variables. Each of these variables are stored as as numbers (not text).
One variable is found in Data and has the value of 9.5
.Site.Data.pricing.spoon
The other variable is found in Front Matter and has the value of 1.5
.Params.base_plus
My goal is to add these two numbers together. So, I used the following code:
{{ $price := float .Site.Data.pricing.spoon | lang.FormatNumber 2 }}
{{ $base_plus := float .Params.base_plus | lang.FormatNumber 2 }}
And when I add them together with add, I would hope to get 11 (9.5 + 1.5)
{{ add $price $base_plus }}
But what I get is a concatenation of the two variables: 9.501.50
I feel like I’m missing something simple here. How do I get those two numbers to sum, not “concatenate”.