Intl.NumberFormat either 0 or two fraction digits : <p>My formatter looks like this</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const formatter = new Intl.NumberFormat('en-NZ', {
  style: 'currency',
  currency: 'NZD',
  minimumFractionDigits: 2,
});</code></pre>
</div>
</div>
</p>

<p>How can I adjust this so that whole numbers have 0 fraction digits</p>

<pre><code>formatter.format(4); // want output "$4"
</code></pre>

<p>whilst fractions always show two digits?</p>

<pre><code>formatter.format(4.1); // want output "$4.10"
</code></pre>
