<pre><code>$ helm version
version.BuildInfo{Version:&quot;v3.3.0&quot;, GitCommit:&quot;8a4aeec08d67a7b84472007529e8097ec3742105&quot;, GitTreeState:&quot;dirty&quot;, GoVersion:&quot;go1.14.6&quot;}
</code></pre>
<p>So I have my template:</p>
<pre class="lang-yaml prettyprint-override"><code>  minAvailable: {{ mul .Values.autoscaling.minReplicas 0.75 }}
</code></pre>
<p>values.yaml:</p>
<pre class="lang-yaml prettyprint-override"><code>autoscaling:
  minReplicas: 3
</code></pre>
<p>I would have expected a rendered output of <code>2.25</code>, but I get 0 (<code>3 * 0</code> because <code>0.75</code> gets floored...)</p>
<p>I've tried things like</p>
<pre class="lang-yaml prettyprint-override"><code>  minAvailable: {{ mul (float .Values.autoscaling.minReplicas) 0.75 }}
</code></pre>
<p>Ultimately I'm going to <code>floor</code> the value to get back to an int...</p>
<pre class="lang-yaml prettyprint-override"><code>  minAvailable: {{ floor ( mul .Values.autoscaling.minReplicas 0.75 ) }}
</code></pre>
<p>But I just don't understand why I can't seem to do simple float arithmetic</p>
<hr />
<p>Other things I've tried</p>
<pre class="lang-yaml prettyprint-override"><code>  minAvailable: {{ float64 .Values.autoscaling.minReplicas }} 
</code></pre>
<pre class="lang-yaml prettyprint-override"><code>  minAvailable: {{ float64 .Values.autoscaling.minReplicas | toString }} 
</code></pre>
<p>nothing produces a float number....</p>
<p>I've even tried doing this in values.yaml</p>
<pre><code>autoscaling:
  minReplicas: 3.0
</code></pre>

Callum Linington
<p>Helm and its templates support the default Go <a href="https://pkg.go.dev/text/template?utm_source=godoc#hdr-Functions" rel="noreferrer">text/template</a> functions and the function provided by the <a href="https://masterminds.github.io/sprig/" rel="noreferrer">Sprig</a> extension. Since Sprig version <a href="https://github.com/Masterminds/sprig/releases/tag/v3.2.0" rel="noreferrer">3.2</a> it also supports <a href="https://masterminds.github.io/sprig/mathf.html" rel="noreferrer">Float Math Functions</a> like <code>addf</code>, <code>subf</code>, <code>mulf</code>, <code>divf</code>, etc. In your case you would just need:</p>
<pre><code>  minAvailable: {{ mulf .Values.autoscaling.minReplicas 0.75 }}
</code></pre>
