Interview Prep/Helm/Templating: Go Templates & Sprig

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.

All Helm questions Roadmap: Helm

More on Templating: Go Templates & Sprig