Helm values round-trip through JSON, so every YAML number enters the
template engine as a float64 regardless of whether the source was written
as "9" or "9.0". The BurntSushi TOML encoder inspects the Go type via
reflection and writes float64(9) as "9.0", which surprises users whose
values look like integers. encoding/json already omits the trailing ".0"
for whole-number float64 values, so toJson does not exhibit the same
issue; this change brings toToml in line with toJson.
The fix normalizes whole-number float64 values to int64 inside toToml
only, leaving NaN, Inf, non-whole floats, and out-of-range values
untouched. Scoping the change to the encoding path preserves the
in-template type of values returned by typeOf/typeIs, avoiding the
ecosystem regression that caused #13533 to be reverted in #30884.
Closes#32035
Signed-off-by: barry3406 <duan3406@gmail.com>