<?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: Get Precision for Text Value in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/get-precision-for-text-value/m-p/11715839#M10161</link>
    <description>&lt;P&gt;Thanh you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;This working fine.&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2023 14:54:27 GMT</pubDate>
    <dc:creator>traiduong014969</dc:creator>
    <dc:date>2023-01-30T14:54:27Z</dc:date>
    <item>
      <title>Get Precision for Text Value</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-precision-for-text-value/m-p/11714001#M10158</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recently, I how to learn get Coordinate value from click by mouse. However, the value that i receive has many number behind "." . So I want to get a number that precision is ".00". For example Point 1 (5.23, 6.45, 5,77)&lt;/P&gt;&lt;P&gt;NOT ((5.23&lt;FONT color="#FF0000"&gt;434645&lt;/FONT&gt;, 6.45&lt;FONT color="#FF0000"&gt;463463456&lt;/FONT&gt;, &lt;FONT color="#000000"&gt;5.77&lt;FONT color="#FF0000"&gt;xxx-xxxxxxxx&lt;/FONT&gt;&lt;/FONT&gt;). You can see the snapshot below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="traiduong014969_0-1675012316665.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1168692iDDAB4AC73B226F08/image-size/medium?v=v2&amp;amp;px=400" role="button" title="traiduong014969_0-1675012316665.png" alt="traiduong014969_0-1675012316665.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Someone can help me edit again this code&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[CommandMethod("11GetPoint")]
        public void 11GetPoint()
        {
            Editor ed = AcAp.DocumentManager.MdiActiveDocument.Editor;
            PromptPointOptions pr = new PromptPointOptions("Click mouse to get point");
            pr.AllowNone = true;
            pr.AllowArbitraryInput = true;   
            PromptPointResult kq = ed.GetPoint(pr);

            if (kq.Status != PromptStatus.OK) return;
            pr.BasePoint = kq.Value;
            pr.UseBasePoint = true;
            
            PromptResult kq1 = ed.GetPoint(pr);
        
            if (kq1.Status != PromptStatus.OK) return;
            
            ed.WriteMessage("\np1 = " + kq.Value.ToString() + "p2 = " + kq1.ToString());


        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 17:16:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-precision-for-text-value/m-p/11714001#M10158</guid>
      <dc:creator>traiduong014969</dc:creator>
      <dc:date>2023-01-29T17:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get Precision for Text Value</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-precision-for-text-value/m-p/11714021#M10159</link>
      <description>&lt;P&gt;Use the Fixed-point formatting: ToString("F2")&lt;/P&gt;
&lt;P&gt;See &lt;A href="https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings" target="_blank" rel="noopener"&gt;THIS&lt;/A&gt; for more on string formatting.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 17:34:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-precision-for-text-value/m-p/11714021#M10159</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2023-01-29T17:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get Precision for Text Value</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-precision-for-text-value/m-p/11714036#M10160</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The Point3d structure implements IFormatable so you can pass a format to the ToString method (this requires to also pass a FormatProvider)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;ed.WriteMessage("\np1 = " 
    + kq.Value.ToString("0.00", CultureInfo.CurrentCulture) 
    + "p2 = " 
    + kq1.Value.ToString("0.00", CultureInfo.CurrentCulture));&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This can be simplified using the overload of &lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_EditorInput_Editor_WriteMessage_string_params_object__" target="_blank" rel="noopener"&gt;Editor.WriteMessage&lt;/A&gt; method which takes a params object[] argument(s).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;ed.WriteMessage("\np1 = {0:0.00} p2 = {1:0.00}", kq.Value, kq1.Value);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or the (not so) new &lt;A href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/interpolated" target="_blank" rel="noopener"&gt;string interpolation&lt;/A&gt; using $.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;ed.WriteMessage($"\np1 = {kq.Value:0.00} p2 = {kq1.Value:0.00}");&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 17:46:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-precision-for-text-value/m-p/11714036#M10160</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-01-29T17:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get Precision for Text Value</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-precision-for-text-value/m-p/11715839#M10161</link>
      <description>&lt;P&gt;Thanh you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;This working fine.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 14:54:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-precision-for-text-value/m-p/11715839#M10161</guid>
      <dc:creator>traiduong014969</dc:creator>
      <dc:date>2023-01-30T14:54:27Z</dc:date>
    </item>
  </channel>
</rss>

