Hello,
Strange behaviour when I add 2 float (being with 2 decimal or converted from integer).
It works fine. Values are correct (ex 136.22) , but sometimes I get a 13rd digit (ex : 2796.2200000000003 instead of 2796.22)
This happens on some cases, and there is no pattern at all because source numbers are random ones.
{{- $valOrigineCol := float (index ($.Scratch.Get "listeTotaux1Categ_Temp") $j) -}}
{{- $val2add := float (lang.NumFmt 2 $val_US_str "- .") -}}
{{- $valResult := add $val2add $valOrigineCol -}}
Problem is with $valResult (when this happens $valOrigineCol & $val2add are OK)
- 153.68 + 268 = 421.68
- 1136.22 + 1660 = 2796.2200000000003
I’m puzzled as I didn’t found any similar case searching the web/Hugo forum.
Mac OS + Hugo 0.37.1