<?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: &amp;amp;Parameter - String to [.X] decimal places?? in 3D Part &amp; Assembly Design</title>
    <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997459#M138350</link>
    <description>&lt;P&gt;To try something, I defined two parameters, "numRaw" a real number, and "numRounded" a STRING.&lt;/P&gt;
&lt;P&gt;The following relations assigned the raw value and then used it to build a string to represent your desired result.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;numraw = 0.00654322641148869
IF numraw &amp;lt; 1.0
  numrounded = "0."
ELSE
  numrounds = ITOS ( floor ( numraw ) ) + "."
ENDIF
numrounded = numrounded + EXTRACT ( ITOS ( 10^8* ( 1 + numraw - floor ( numraw ) ) ), 2, 8 )&lt;/LI-CODE&gt;
&lt;P&gt;The ITOS function does an inherent rounding when used, or you could add specific calculations to round the number in whatever explicit manner you wish.&lt;/P&gt;
&lt;P&gt;Parameters might look like they aren't using enough precision, but it's more a matter of what they are showing, not what they are holding. It's kind of like when you enter a number in an Excel cell - it might look like 2.556, but the actual value stored is 2.555789762 or whatever. I'm not sure what the actual decimal place limitation in Creo is, but it's definitely more places than just 8.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Feb 2025 16:48:20 GMT</pubDate>
    <dc:creator>KenFarley</dc:creator>
    <dc:date>2025-02-07T16:48:20Z</dc:date>
    <item>
      <title>&amp;Parameter - String to [.X] decimal places??</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997390#M138338</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a situation where I need to express a number to 8 decimal places in a drawing. I have created a parameter in the model as a string due to the number of digits in the raw number.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Unfortunately when attempting in the standard approach in the drawing [.8] does not work after the &amp;amp;parameter, is there another syntax I need to use with this not being a real number?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The number is: 0.00654322641148869&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I cannot enter the parameter as a real number due to the precision limitation on these values, hence using string.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hopefully someone can guide me in the right direction.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 13:42:49 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997390#M138338</guid>
      <dc:creator>IE_1</dc:creator>
      <dc:date>2025-02-07T13:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: &amp;Parameter - String to [.X] decimal places??</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997419#M138345</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/636113"&gt;@IE_1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, the [.#] notation for limiting the number of decimal digits is not recognized in a string type parameter&lt;/P&gt;
&lt;P&gt;I think we need to use some additional relation functions like extract&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;extract(string, position, length)&lt;/LI-CODE&gt;
&lt;P&gt;for example:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;test="0.1234567890123456789"
limit=extract(test,1,(search(test,".")+8))&lt;/LI-CODE&gt;
&lt;P&gt;this sets the parameter TEST to the string value, then extracts from that parameter, starting from character #1 through 8 more characters from the position of the "."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example for removing the lead 0 for the same test parameter would be&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;limit=extract(test,search(test,"."),9)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 14:46:36 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997419#M138345</guid>
      <dc:creator>MikeBennett</dc:creator>
      <dc:date>2025-02-07T14:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: &amp;Parameter - String to [.X] decimal places??</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997436#M138347</link>
      <description>&lt;P&gt;Thanks Mike, in my drawing what would I be calling up?&amp;nbsp; &amp;amp;............&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 15:28:20 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997436#M138347</guid>
      <dc:creator>IE_1</dc:creator>
      <dc:date>2025-02-07T15:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: &amp;Parameter - String to [.X] decimal places??</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997441#M138348</link>
      <description>&lt;P&gt;I've worked it out, thanks&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 15:44:22 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997441#M138348</guid>
      <dc:creator>IE_1</dc:creator>
      <dc:date>2025-02-07T15:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: &amp;Parameter - String to [.X] decimal places??</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997443#M138349</link>
      <description>&lt;P&gt;Would it be possible to add a rounding function to this do you think?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 15:58:56 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997443#M138349</guid>
      <dc:creator>IE_1</dc:creator>
      <dc:date>2025-02-07T15:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: &amp;Parameter - String to [.X] decimal places??</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997459#M138350</link>
      <description>&lt;P&gt;To try something, I defined two parameters, "numRaw" a real number, and "numRounded" a STRING.&lt;/P&gt;
&lt;P&gt;The following relations assigned the raw value and then used it to build a string to represent your desired result.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;numraw = 0.00654322641148869
IF numraw &amp;lt; 1.0
  numrounded = "0."
ELSE
  numrounds = ITOS ( floor ( numraw ) ) + "."
ENDIF
numrounded = numrounded + EXTRACT ( ITOS ( 10^8* ( 1 + numraw - floor ( numraw ) ) ), 2, 8 )&lt;/LI-CODE&gt;
&lt;P&gt;The ITOS function does an inherent rounding when used, or you could add specific calculations to round the number in whatever explicit manner you wish.&lt;/P&gt;
&lt;P&gt;Parameters might look like they aren't using enough precision, but it's more a matter of what they are showing, not what they are holding. It's kind of like when you enter a number in an Excel cell - it might look like 2.556, but the actual value stored is 2.555789762 or whatever. I'm not sure what the actual decimal place limitation in Creo is, but it's definitely more places than just 8.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 16:48:20 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997459#M138350</guid>
      <dc:creator>KenFarley</dc:creator>
      <dc:date>2025-02-07T16:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: &amp;Parameter - String to [.X] decimal places??</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997460#M138351</link>
      <description>&lt;P&gt;With Creo 11, there is a RTOS function that will make these conversions easier.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 16:51:00 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997460#M138351</guid>
      <dc:creator>BenLoosli</dc:creator>
      <dc:date>2025-02-07T16:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: &amp;Parameter - String to [.X] decimal places??</title>
      <link>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997462#M138352</link>
      <description>&lt;P&gt;Yeah, I saw that, but we won't be using Creo 11 for a long time. Licensing shenanigans, I'm afraid.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 16:57:46 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/3D-Part-Assembly-Design/amp-Parameter-String-to-X-decimal-places/m-p/997462#M138352</guid>
      <dc:creator>KenFarley</dc:creator>
      <dc:date>2025-02-07T16:57:46Z</dc:date>
    </item>
  </channel>
</rss>

