<p dir="auto">The space at the end here seems to be a bug:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; @sprintf(&quot;%.6g&quot;, 1.0)
&quot;1 &quot;"><pre class="notranslate"><code class="notranslate">julia&gt; @sprintf("%.6g", 1.0)
"1 "
</code></pre></div>
<p dir="auto">The printf <code class="notranslate">%g</code> specifier will at times output an additional, unnecessary trailing space:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; @sprintf &quot;%g&quot; 1
&quot;1 &quot;
julia&gt; @sprintf &quot;%.8g&quot; 23
&quot;23 &quot;
julia&gt; @sprintf &quot;%.2g&quot; 23
&quot;23&quot;"><pre class="notranslate"><code class="notranslate">julia&gt; @sprintf "%g" 1
"1 "
julia&gt; @sprintf "%.8g" 23
"23 "
julia&gt; @sprintf "%.2g" 23
"23"
</code></pre></div>
<p dir="auto">CC <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dfannius/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dfannius">@dfannius</a> (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="91944011" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/11941" data-hovercard-type="pull_request" data-hovercard-url="/JuliaLang/julia/pull/11941/hovercard" href="https://github.com/JuliaLang/julia/pull/11941">#11941</a>)</p>