<?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 Extra accuracy STR{2} in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Extra-accuracy-STR-2/m-p/294858#M5792</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hello!&lt;BR /&gt;
I need to mathimatic rounding:&lt;BR /&gt;
0.0245 -&amp;gt; 0.03&lt;BR /&gt;
&lt;BR /&gt;
But in this code &lt;BR /&gt;
&lt;BR /&gt;
value = 0.0245&lt;BR /&gt;
string_result = STR("%.2", value)&lt;BR /&gt;
&lt;BR /&gt;
i have &lt;BR /&gt;
0.02&lt;BR /&gt;
&lt;BR /&gt;
May be i need to use STR{2} with extra accuracy flags...&lt;BR /&gt;
But in documentation of GDL no examples &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_sad.gif" style="display : inline;" /&gt;((&lt;BR /&gt;
&lt;BR /&gt;
Please, help me!)&lt;/R&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 05 Jul 2017 19:11:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-07-05T19:11:27Z</dc:date>
    <item>
      <title>Extra accuracy STR{2}</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Extra-accuracy-STR-2/m-p/294858#M5792</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hello!&lt;BR /&gt;
I need to mathimatic rounding:&lt;BR /&gt;
0.0245 -&amp;gt; 0.03&lt;BR /&gt;
&lt;BR /&gt;
But in this code &lt;BR /&gt;
&lt;BR /&gt;
value = 0.0245&lt;BR /&gt;
string_result = STR("%.2", value)&lt;BR /&gt;
&lt;BR /&gt;
i have &lt;BR /&gt;
0.02&lt;BR /&gt;
&lt;BR /&gt;
May be i need to use STR{2} with extra accuracy flags...&lt;BR /&gt;
But in documentation of GDL no examples &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_sad.gif" style="display : inline;" /&gt;((&lt;BR /&gt;
&lt;BR /&gt;
Please, help me!)&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Jul 2017 19:11:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Extra-accuracy-STR-2/m-p/294858#M5792</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-05T19:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extra accuracy STR{2}</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Extra-accuracy-STR-2/m-p/294859#M5793</link>
      <description>&lt;BLOCKQUOTE&gt;Tsepov wrote:&lt;BR /&gt;Hello!&lt;BR /&gt;
I need to mathimatic rounding:&lt;BR /&gt;
0.0245 -&amp;gt; 0.03&lt;BR /&gt;
&lt;BR /&gt;
But in this code &lt;BR /&gt;
&lt;BR /&gt;
value = 0.0245&lt;BR /&gt;
string_result = STR("%.2", value)&lt;BR /&gt;
&lt;BR /&gt;
i have &lt;BR /&gt;
0.02&lt;BR /&gt;
&lt;BR /&gt;
May be i need to use STR{2} with extra accuracy flags...&lt;BR /&gt;
But in documentation of GDL no examples &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_sad.gif" style="display : inline;" /&gt;((&lt;BR /&gt;
&lt;BR /&gt;
Please, help me!)&lt;/BLOCKQUOTE&gt;

2.4xxx will mathematically round to 2.0&lt;BR /&gt;
The rounding point is 0.5&lt;BR /&gt;
&lt;BR /&gt;
If you add something to it then it will round, but no program i know will round a 0.4 to the next hole number...&lt;BR /&gt;
&lt;BR /&gt;
With crazy clients who wanted custom rounding, we built rounding factors that we added to numbers to get the desired result, i.e. you could add 0.005 to your 0.0245 to give you a roundable number&lt;BR /&gt;
therfore &lt;BR /&gt;
a 0.02450001 that displays  0.025 at 3DPs and displays as 0.02 at 2DPs&lt;BR /&gt;
&lt;BR /&gt;
becomes 0.02500001  that displays as 0.025 at 3DPs and displays as 0.03 at 2DPs&lt;BR /&gt;
&lt;BR /&gt;
it depends on the level of accuracy that you work in...</description>
      <pubDate>Thu, 06 Jul 2017 01:20:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Extra-accuracy-STR-2/m-p/294859#M5793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-06T01:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extra accuracy STR{2}</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Extra-accuracy-STR-2/m-p/294860#M5794</link>
      <description>I suppose you don't actually want to "round" something, but to make it always bigger. This is called ceiling.&lt;BR /&gt;
There is indeed a function called "CEIL" in GDL, but the result will be of course Integer, not Float:&lt;BR /&gt;

&lt;PRE&gt;c = CEIL(-2.25 )   ! =-2

w = 25.276
w = CEIL(w)        ! w=26&lt;/PRE&gt;

So if you want it to remain Float you need to e.g.
&lt;PRE&gt;con = 100

n = 0.0245
n * con    ! n=2.45

n = CEIL(n)     ! n=3

n = n / con     ! n=0.03&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jul 2017 12:35:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Extra-accuracy-STR-2/m-p/294860#M5794</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2017-07-06T12:35:55Z</dc:date>
    </item>
  </channel>
</rss>

