<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Money on Brian Faust</title><link>https://vacua.dev/tags/money/</link><description>Recent content in Money on Brian Faust</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 01 Jan 0001 00:00:00 +0000</lastBuildDate><atom:link href="https://vacua.dev/tags/money/rss.xml" rel="self" type="application/rss+xml"/><item><title>Money Is Not a Floating-Point Number</title><link>https://vacua.dev/thoughts/money-is-not-a-floating-point-number/</link><pubDate>Mon, 01 May 2017 00:00:00 +0000</pubDate><guid>https://vacua.dev/thoughts/money-is-not-a-floating-point-number/</guid><description>&lt;p&gt;A booking-time price arrived as four values:&lt;/p&gt;
&lt;figure class="code-figure"&gt;
 &lt;div class="code-block" data-copy-code&gt;
 &lt;button class="copy-code" type="button" aria-label="Copy code"&gt;copy&lt;/button&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net amount: 407
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tax rate: 25.5%
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tax amount: 104
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gross amount: 511&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
 &lt;/div&gt;
&lt;/figure&gt;
&lt;p&gt;The amounts are integers in the currency&amp;rsquo;s minor unit. The rate is a decimal
ratio. The contract checks that net plus tax equals gross and that applying the
declared rounding rule to net multiplied by the rate produces the tax amount.&lt;/p&gt;
&lt;p&gt;None of those details is decorative. Remove the unit, mix the rate&amp;rsquo;s two
representations, or let two services round at different stages, and the same
price can stop balancing.&lt;/p&gt;</description></item></channel></rss>