<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Rounding Error when summing up multiple fields in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11409210#M51065</link>
    <description>&lt;P&gt;Whether to sum rounded numbers or round the sum of higher precision numbers depends on the real world use of the AutoCAD drawing. The fabrication method of an object will determine the appropriate dimensional precision for that object. For example, the precision of locating and then drilling mounting holes near the ends of a bar determines the tolerance for the individual bar. An assembly of multiple bars end-to-end or as a truss or frame should consider the possible variation in the individual bar lengths which could be different than using the nominal length of each bar and then applying a tolerance.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Sep 2022 16:00:54 GMT</pubDate>
    <dc:creator>leeminardi</dc:creator>
    <dc:date>2022-09-08T16:00:54Z</dc:date>
    <item>
      <title>Rounding Error when summing up multiple fields</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11407814#M51058</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm summing up multiple areas, but the sum of the fields is off due to a rounding error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The single areas are displayed with the precision of 2 decimals, but the field that's summing up all of them is using more, so the output differs to the sum I get if I sum them up "manually". The formula summing up the multiple instances are even displayed the right way.&lt;/P&gt;&lt;P&gt;Is there any way to fix that without changing the number of decimals?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1112994iED9A599AB2BD658E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 06:56:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11407814#M51058</guid>
      <dc:creator>mp9XXKQ</dc:creator>
      <dc:date>2022-09-08T06:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Error when summing up multiple fields</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11408459#M51059</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12864611"&gt;@mp9XXKQ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try this.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. UNITS on command line=&amp;gt;Make precision 2 decimal places=&amp;gt;OK&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="101.JPG" style="width: 347px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1113162i7EFA038171288CA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="101.JPG" alt="101.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. In the field window-&amp;gt;Make precision=Current&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="102.JPG" style="width: 590px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1113163i52A339A0FB8A0898/image-size/large?v=v2&amp;amp;px=999" role="button" title="102.JPG" alt="102.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Go back to UNITS and &lt;U&gt;change the precision&lt;/U&gt; to test the results. On command line you'll need to regen all (REA) for the field to update.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 11:38:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11408459#M51059</guid>
      <dc:creator>ChicagoLooper</dc:creator>
      <dc:date>2022-09-08T11:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Error when summing up multiple fields</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11408506#M51060</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12864611"&gt;@mp9XXKQ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;....&amp;nbsp;&lt;/SPAN&gt;Is there any way to fix that without changing the number of decimals?&amp;nbsp;&lt;SPAN&gt;....&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I doubt it.&amp;nbsp; The error is not in the rounding -- the rounding is presumably being done correctly -- but in the use of rounded values to add up to something rounded to more decimal places.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will inevitably happen if all or most of the true values are such that they are being rounded &lt;EM&gt;up&lt;/EM&gt;, especially if they're not very far above the rounding breaking point so they're rounding up comparatively far.&amp;nbsp; If the first three in your example are &lt;EM&gt;true&lt;/EM&gt; values of 3.8&lt;STRONG&gt;17&lt;/STRONG&gt;, 3.7&lt;STRONG&gt;06&lt;/STRONG&gt;, 1.8&lt;STRONG&gt;755&lt;/STRONG&gt;, then all those differences between true and rounded values will be &lt;EM&gt;adding extra&lt;/EM&gt; to the sum of rounded values.&amp;nbsp; Just those three crank it up by a total of 0.0115, which more than kicks the total up a notch at 2-decimal-place rounding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The same effect will happen in the opposite direction if too many of the true values are being rounded &lt;EM&gt;down&lt;/EM&gt;.&amp;nbsp; Sometimes the ups and downs will balance out, but obviously you can't count on that.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 11:54:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11408506#M51060</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-09-08T11:54:07Z</dc:date>
    </item>
    <item>
      <title>Betreff: Rounding Error when summing up multiple fields</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11408539#M51061</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yes, Autocad don't calculate with the displaying values, it uses the real values..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;gt;&amp;gt;"Is there any way to fix that without changing the number of decimals?"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;multiply the individual values by 100,&lt;/P&gt;
&lt;P&gt;TRUNC this result&lt;/P&gt;
&lt;P&gt;and use the conversion factor of [additional format] to multiply the result by 0.01 back to your needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I am not wrong, that should do the job!?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="truncX100.JPG" style="width: 383px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1113197i57E7F7D270F8C70F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="truncX100.JPG" alt="truncX100.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 12:12:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11408539#M51061</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2022-09-08T12:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Error when summing up multiple fields</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11408751#M51062</link>
      <description>&lt;P&gt;The sum of full precision numbers that are rounded to a fixed precision will probably be different than the sum of rounded numbers to the same precision.&amp;nbsp; For example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leeminardi_0-1662642362943.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1113216i1EF34301ED31F3FB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leeminardi_0-1662642362943.png" alt="leeminardi_0-1662642362943.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You should add the &lt;STRONG&gt;round&lt;/STRONG&gt; function to your field expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The AutoCAD field &lt;STRONG&gt;round&lt;/STRONG&gt; function is different than the Excel round function.&amp;nbsp; AutoCAD's round function rounds to the closest integer.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;round&lt;/STRONG&gt;(real) = Rounded to the nearest integer&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The expression for rounding to 2 decimal places would look something like the following where "number" is the field reference to the value.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;round(100.0*number)/100.0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 13:33:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11408751#M51062</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2022-09-08T13:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Error when summing up multiple fields</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11408983#M51063</link>
      <description>&lt;P&gt;I didn't see&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp;'s post when I made my post.&amp;nbsp; TRUC or ROUND can achieve the same results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example with ROUND.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leeminardi_0-1662648751993.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1113292i0AA158609234AB97/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leeminardi_0-1662648751993.png" alt="leeminardi_0-1662648751993.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 14:53:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11408983#M51063</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2022-09-08T14:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Error when summing up multiple fields</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11409135#M51064</link>
      <description>&lt;P&gt;You are probably summing up already rounded values. Make sure that the individual fields you are summing are NOT rounded (format: none or large precision).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Vladimir Michl, &lt;A href="http://www.arkance-systems.cz" target="_blank"&gt;www.arkance-systems.cz&lt;/A&gt; - &lt;A href="http://www.cadforum.cz" target="_blank"&gt;www.cadforum.cz&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 15:34:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11409135#M51064</guid>
      <dc:creator>vladimir_michl</dc:creator>
      <dc:date>2022-09-08T15:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding Error when summing up multiple fields</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11409210#M51065</link>
      <description>&lt;P&gt;Whether to sum rounded numbers or round the sum of higher precision numbers depends on the real world use of the AutoCAD drawing. The fabrication method of an object will determine the appropriate dimensional precision for that object. For example, the precision of locating and then drilling mounting holes near the ends of a bar determines the tolerance for the individual bar. An assembly of multiple bars end-to-end or as a truss or frame should consider the possible variation in the individual bar lengths which could be different than using the nominal length of each bar and then applying a tolerance.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 16:00:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-error-when-summing-up-multiple-fields/m-p/11409210#M51065</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2022-09-08T16:00:54Z</dc:date>
    </item>
  </channel>
</rss>

