Why do numbers from values sometimes render as `1e+06` or `3000.0`?
AdvancedConceptTemplating: Go Templates & Sprig
Answer
YAML numbers are parsed into float64 in Go maps. Large integers then format in scientific notation, and arithmetic results may carry decimals. Convert explicitly:
maxBytes: {{ .Values.maxBytes | int64 }} # 1000000 instead of 1e+06
port: {{ .Values.port | int }}
Use int, int64 or float64 before printf "%d", comparisons and math (add, mul, div). For identifiers like account IDs, keep them as quoted strings in values.
More on Templating: Go Templates & Sprig
What template language does Helm use?BeginnerWhat does the dot (`.`) mean in a Helm template?BeginnerWhat is `$` and when do you need it?IntermediateHow does whitespace control (`{{-` and `-}}`) work?BeginnerHow do `if`, `else if` and `else` evaluate truthiness?BeginnerWhat do `and`, `or`, `not`, `eq`, `ne`, `lt`, `gt` look like in Helm?Beginner