<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="40895" data-post-id="40895">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><code>100.00 + 10 == 110.00</code> is only true if they are both of the same currency.  Its money, so the details are important.</p>
<p>As <a class="mention" href="/u/tmbb" rel="nofollow">@tmbb</a> suggests, picking a money lib and convert everything to money first so you know you’re dealing with a currency would be a good recommendation.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="40895" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/built-in-datatype-for-handling-money-values/6774/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-40895" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="40895"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="40897" data-post-id="40897">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Ankhers" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Ankhers
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-post-not-found" data-username="CharlesO" data-post="13" data-topic="6774">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/charleso/48/34571_2.png" class="avatar"> CharlesO:</div>
<blockquote>
<pre data-code-wrap="elixir"><code class="lang-elixir">%{ 903 =&gt; %{
    {1, "accrued-interest-to-date"} =&gt; #Decimal&lt;100.0&gt;, 
    {1, "cost"} =&gt; #Decimal&lt;100.0&gt;, 
    {1, "description"} =&gt; "description", 
    {1, "face-value"} =&gt; #Decimal&lt;100.0&gt;, 
    {1, "holding-units"} =&gt; #Decimal&lt;6.123399999999998&gt;, 
    {1, "interest-rate"} =&gt; #Decimal&lt;75.0&gt;,
    {1, "issue-amount"} =&gt; #Decimal&lt;100.0&gt;, 
    {1, "market-value"} =&gt; #Decimal&lt;100.0&gt;, 
    {1, "maturity-date"} =&gt; "2017-01-01",
    {1, "serial-no"} =&gt; 0,
</code></pre>
</blockquote>
</aside>
<p>This is the data you provided in your previous post. Your output gives you an error because you are expecting some kind of number, but you have a date in the “maturity-date” and a string in the “description” field. I’m not sure if this is intended or not, but it is not a number, so you should not be iterating over it as if it were.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="40897" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/built-in-datatype-for-handling-money-values/6774/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-40897" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="40897"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="40899" data-post-id="40899">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="CharlesO" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/CharlesO/120/34571_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  CharlesO
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>i’m testing for the field type before adding. I have solved it, there was an error is my example. thanks</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="40899" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/built-in-datatype-for-handling-money-values/6774/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-40899" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="40899"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="41356" data-post-id="41356">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="CharlesO" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/CharlesO/120/34571_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  CharlesO
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>see this answer:</p>
<aside class="onebox stackexchange" data-onebox-src="https://stackoverflow.com/questions/45040477/what-is-the-recommended-data-type-for-handling-money-just-2-decimal-places-in/45041000#45041000">
  <header class="source">

      <a href="https://stackoverflow.com/questions/45040477/what-is-the-recommended-data-type-for-handling-money-just-2-decimal-places-in/45041000#45041000" target="_blank" rel="noopener nofollow ugc">stackoverflow.com</a>
  </header>

  <article class="onebox-body">
      <a href="https://stackoverflow.com/users/365377/jesse-shieh" target="_blank" rel="noopener nofollow ugc">
    <img alt="Jesse Shieh" src="https://www.gravatar.com/avatar/6f5d678558599d715bfaa6284509e99f?s=256&amp;d=identicon&amp;r=PG" class="thumbnail onebox-avatar" width="256" height="256">
  </a>

<h4>
  <a href="https://stackoverflow.com/questions/45040477/what-is-the-recommended-data-type-for-handling-money-just-2-decimal-places-in/45041000#45041000" target="_blank" rel="noopener nofollow ugc">What is the recommended data type for handling Money (just 2-decimal places) in Elixir/Erlang?</a>
</h4>

<div class="tags">
  <strong>erlang, elixir</strong>
</div>

<div class="date">
  
  answered by
  <a href="https://stackoverflow.com/users/365377/jesse-shieh" target="_blank" rel="noopener nofollow ugc">
    Jesse Shieh
  </a>
  on <a href="https://stackoverflow.com/questions/45040477/what-is-the-recommended-data-type-for-handling-money-just-2-decimal-places-in/45041000#45041000" target="_blank" rel="noopener nofollow ugc">05:22PM - 11 Jul 17 UTC</a>
</div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>In most cases it would not make any sense to speak of fractional cents…</p>
<p>like you have correctly listed,</p>
<blockquote>
<p>52 currencies that have no decimal places<br>
239 that have 2 decimal places<br>
3 that have 3 decimal places<br>
1 that has four decimal places</p>
</blockquote>
<p>Pre-setting the number of decimal digits, then scaling all values to integer units, should be a big win for simplicity as well as performance.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="41356" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/built-in-datatype-for-handling-money-values/6774/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-41356" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="41356"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="125205" data-post-id="125205">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="CharlesO" data-post="16" data-topic="6774">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/charleso/48/34571_2.png" class="avatar"> CharlesO:</div>
<blockquote>
<p>Pre-setting the number of decimal digits, then scaling all values to integer units, should be a big win for simplicity as well as performance</p>
</blockquote>
</aside>
<p>I know its an older post but I wanted to observe that what is described by <a class="mention" href="/u/charleso" rel="nofollow">@CharlesO</a> is basically what the <a href="https://hex.pm/packages/decimal" rel="nofollow">Decimal</a> package does.  It’s a lovely piece of code (as you’d expect from <a class="mention" href="/u/ericmj" rel="nofollow">@ericmj</a>). It’s hard to consider using anything other than a decimal format for money types (the representation under the covers matters less - but Decimal is very tightly optimised).  And as a lib writer, I find it hard to consider a money type that isn’t tagged in some way with a currency type.  There’s just too many things to go wrong.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="125205" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/built-in-datatype-for-handling-money-values/6774/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-125205" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="125205"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="125242" data-post-id="125242">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="kip" data-post="17" data-topic="6774">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/48/1440_2.png" class="avatar"> kip:</div>
<blockquote>
<p>I know its an older post but I wanted to observe that what is described by <a class="mention" href="/u/charleso" rel="nofollow">@CharlesO</a> is basically what the <a href="https://hex.pm/packages/decimal" rel="nofollow">Decimal</a> package does. It’s a lovely piece of code (as you’d expect from <a class="mention" href="/u/ericmj" rel="nofollow">@ericmj</a>). It’s hard to consider using anything other than a decimal format for money types (the representation under the covers matters less - but Decimal is very tightly optimised). And as a lib writer, I find it hard to consider a money type that isn’t tagged in some way with a currency type. There’s just too many things to go wrong.</p>
</blockquote>
</aside>
<p>Decimal is good as the underlying type, but it doesn’t enforce handling partial unrepresentable money values, or verifying the same type of money is being compared/added/etc…  That’s why the ex_money library is useful.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="125242" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/built-in-datatype-for-handling-money-values/6774/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-125242" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="125242"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="125267" data-post-id="125267">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="CharlesO" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/CharlesO/120/34571_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  CharlesO
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>If you are responsible for a system that <strong>will only ever have</strong> 2 decimal point numbers and the <strong>operations involved are simply addition, subtraction</strong>, hardly ever multiplication or division, I still feel there might be some simplifications that may be obtained by not taking on a dependency.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="125267" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/built-in-datatype-for-handling-money-values/6774/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-125267" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="125267"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="125269" data-post-id="125269">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>In such a case a simplification can indeed be made, but it’s a project specific simplification and non e.g.  a library or even more the core should make. The best case is always that once code is written you can change the currency without touching any of the logic working on the values. Your constraints allow simplifications, but also limit the selection of currencies to be usable. Especially the core (when we’re talking about build in stuff) should not arbitrarily limit the selection of currencies, especially if it’s just because it’s simpler to implement. If you write a library, which does so, it’s fine for as long as you communicate those limitations properly. And on a per project basis you can do what ever you want anyways. On the per project basis I would still suggest wrapping money values in a struct, which is documented to work within the given constraints and add an api to handle the manipulations on the value. If all you do is add and subtract stuff, such a module should be written quite quickly and you can skip external dependencies.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="125269" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/built-in-datatype-for-handling-money-values/6774/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-125269" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="125269"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="125276" data-post-id="125276">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mudasobwa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mudasobwa/120/5298_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mudasobwa
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Cure</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="CharlesO" data-post="19" data-topic="6774">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/charleso/48/34571_2.png" class="avatar"> CharlesO:</div>
<blockquote>
<p>If you are responsible for a system that <strong>will only ever have</strong> 2 decimal point numbers […]</p>
</blockquote>
</aside>
<p>One should not try to build malformed partial implementations in any case, but even if all the currencies were having 2 decimals, the <em>money</em> unlike <em>numbers</em> require an ability to split <code>0.33</code> into two shares, than join them back and get <code>0.33</code>. Otherwise the first audit would dismiss the whole business. That is impossible without very careful implementation, that is IMHO harder than anything else in the field.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="125276" data-batch-url="/posts/batch_likers">
                        5
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/built-in-datatype-for-handling-money-values/6774/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-125276" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="125276"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
    <div class="postbit" id="125339" data-post-id="125339">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="CharlesO" data-post="19" data-topic="6774" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/charleso/48/34571_2.png" class="avatar"> CharlesO:</div>
<blockquote>
<p>If you are responsible for a system that <strong>will only ever have</strong> 2 decimal point numbers and the <strong>operations involved are simply addition, subtraction</strong> , hardly ever multiplication or division, I still feel there might be some simplifications that may be obtained by not taking on a dependency.</p>
</blockquote>
</aside>
<p>Except it is <em>way</em> trivial to accidentally handle, say, a remainder on a division then, that’s the major issue.</p>
<p>You should never use a basic number as a money type, ever ever I would assert.</p>
<p>Whether you use ex_money or make your own, never allow the base monetary value to be altered directly.</p>
<aside class="quote no-group" data-username="mudasobwa" data-post="21" data-topic="6774">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mudasobwa/48/5298_2.png" class="avatar"> mudasobwa:</div>
<blockquote>
<p>One should not try to build malformed partial implementations in any case, but even if all the currencies were having 2 decimals, the <em>money</em> unlike <em>numbers</em> require an ability to split <code>0.33</code> into two shares, than join them back and get <code>0.33</code> . Otherwise the first audit would dismiss the whole business. That is impossible without very careful implementation, that is IMHO harder than anything else in the field.</p>
</blockquote>
</aside>
<p>+1</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="125339" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/built-in-datatype-for-handling-money-values/6774/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-125339" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="125339"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/6774/load_more?page=3">Load more posts (9 remaining)</a>
</div></template></turbo-stream>