You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of Hugo are you using (hugo version)?
0.140.2
Does this issue reproduce with the latest release?
yes
Issue
Having some weirdness going on with a json number, that is interpreted as float and also as integer.
I would understand if it is either float or integer, because of Golangs json parser, but both at the same time?
2) The default representation of a float64 in Go depends on precision (default precision is 6):
package main
import"fmt"funcmain() {
s:= []float64{123456, 1234567}
fmt.Println(s)
}
The above outputs:
[123456 1.234567e+06]
3) Then why don't we see "2.009532e+06" everywhere in the rendered HTML?
Because Go's html/template package is doing some contextual magic when in a JavaScript context (e.g., inside an onclick attribute). I haven't figured out why Go does this. See https://go.dev/play/p/jK2WWmXVfd3, then change to text/template and test again.
What version of Hugo are you using (
hugo version
)?0.140.2
Does this issue reproduce with the latest release?
yes
Issue
Having some weirdness going on with a json number, that is interpreted as float and also as integer.
I would understand if it is either float or integer, because of Golangs json parser, but both at the same time?
Result:
The text was updated successfully, but these errors were encountered: