<?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: String formatting in .NET in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824917#M79802</link>
    <description>If i unserstand it correct maybe this will help you.&lt;BR /&gt;
&lt;BR /&gt;
int Luprec = Application.DocumentManager.MdiActiveDocument.Database.Luprec;&lt;BR /&gt;
&lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
DistFPPrompt = DistFP.ToString("F" + Luprec.ToString());&lt;BR /&gt;
&lt;BR /&gt;
DistSPPrompt = DistSP.ToString("F" + Luprec.ToString());&lt;BR /&gt;
&lt;BR /&gt;
Dist = Math.Abs(DistSP - DistFP);&lt;BR /&gt;
&lt;BR /&gt;
DistPrompt = Dist.ToString("F" + Luprec.ToString());&lt;BR /&gt;
&lt;BR /&gt;
ed.WriteMessage(String.Format("\nabgewickelte Länge = {0}, erster Punkt = &lt;BR /&gt;
{1}, zweiter Punkt = {2}", DistPrompt, DistFPPrompt, DistSPPrompt));&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Roland Feletic&lt;BR /&gt;
Pauser ZT-GMBH&lt;BR /&gt;
http://www.pauser.at&lt;BR /&gt;
&lt;BR /&gt;
hp workstation xw4200, 3GB&lt;BR /&gt;
quadro fx1400&lt;BR /&gt;
AutoCAD 2007, 3DSMax 8.0 SP 2</description>
    <pubDate>Thu, 23 Nov 2006 08:47:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-11-23T08:47:33Z</dc:date>
    <item>
      <title>String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824905#M79790</link>
      <description>Ok, this is not really an acad-related issue, but i'm doing an Acad-net app, &lt;BR /&gt;
so ....&lt;BR /&gt;
&lt;BR /&gt;
In c++ i format at string with dynamic precision using the formatstring &lt;BR /&gt;
"%.*f", m_sPrecision, x&lt;BR /&gt;
&lt;BR /&gt;
How do i do that in .NET. I'm totally lost.&lt;BR /&gt;
&lt;BR /&gt;
Or even better, (look; Acad related) can i format a string the same way as &lt;BR /&gt;
using the %q formaters in ARX.&lt;BR /&gt;
i.e. let Acad format the strings according to the unit-settings&lt;BR /&gt;
&lt;BR /&gt;
/Matt</description>
      <pubDate>Tue, 21 Nov 2006 19:30:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824905#M79790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-21T19:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824906#M79791</link>
      <description>Not sure about the C++ equivalent, but you can use&lt;BR /&gt;
the Autodesk.AutoCAD.Runtime.Converter class in&lt;BR /&gt;
acdbmgd.dll to convert between distance/angle and&lt;BR /&gt;
strings.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message news:5403173@discussion.autodesk.com...&lt;BR /&gt;
Ok, this is not really an acad-related issue, but i'm doing an Acad-net app, &lt;BR /&gt;
so ....&lt;BR /&gt;
&lt;BR /&gt;
In c++ i format at string with dynamic precision using the formatstring &lt;BR /&gt;
"%.*f", m_sPrecision, x&lt;BR /&gt;
&lt;BR /&gt;
How do i do that in .NET. I'm totally lost.&lt;BR /&gt;
&lt;BR /&gt;
Or even better, (look; Acad related) can i format a string the same way as &lt;BR /&gt;
using the %q formaters in ARX.&lt;BR /&gt;
i.e. let Acad format the strings according to the unit-settings&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;/NOSPAM&gt;</description>
      <pubDate>Wed, 22 Nov 2006 02:35:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824906#M79791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-22T02:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824907#M79792</link>
      <description>Brilliant. Just what I wanted.&lt;BR /&gt;
&lt;BR /&gt;
So I can fail to understand the .net string formatting for a couple of weeks &lt;BR /&gt;
more&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:5403635@discussion.autodesk.com...&lt;BR /&gt;
Not sure about the C++ equivalent, but you can use&lt;BR /&gt;
the Autodesk.AutoCAD.Runtime.Converter class in&lt;BR /&gt;
acdbmgd.dll to convert between distance/angle and&lt;BR /&gt;
strings.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:5403173@discussion.autodesk.com...&lt;BR /&gt;
Ok, this is not really an acad-related issue, but i'm doing an Acad-net app,&lt;BR /&gt;
so ....&lt;BR /&gt;
&lt;BR /&gt;
In c++ i format at string with dynamic precision using the formatstring&lt;BR /&gt;
"%.*f", m_sPrecision, x&lt;BR /&gt;
&lt;BR /&gt;
How do i do that in .NET. I'm totally lost.&lt;BR /&gt;
&lt;BR /&gt;
Or even better, (look; Acad related) can i format a string the same way as&lt;BR /&gt;
using the %q formaters in ARX.&lt;BR /&gt;
i.e. let Acad format the strings according to the unit-settings&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Wed, 22 Nov 2006 07:53:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824907#M79792</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-22T07:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824908#M79793</link>
      <description>.NET string formatting doesn't do angles and distances,&lt;BR /&gt;
so unless you need the more generic conversion, its not&lt;BR /&gt;
too helpful.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message news:5403763@discussion.autodesk.com...&lt;BR /&gt;
Brilliant. Just what I wanted.&lt;BR /&gt;
&lt;BR /&gt;
So I can fail to understand the .net string formatting for a couple of weeks &lt;BR /&gt;
more&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:5403635@discussion.autodesk.com...&lt;BR /&gt;
Not sure about the C++ equivalent, but you can use&lt;BR /&gt;
the Autodesk.AutoCAD.Runtime.Converter class in&lt;BR /&gt;
acdbmgd.dll to convert between distance/angle and&lt;BR /&gt;
strings.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:5403173@discussion.autodesk.com...&lt;BR /&gt;
Ok, this is not really an acad-related issue, but i'm doing an Acad-net app,&lt;BR /&gt;
so ....&lt;BR /&gt;
&lt;BR /&gt;
In c++ i format at string with dynamic precision using the formatstring&lt;BR /&gt;
"%.*f", m_sPrecision, x&lt;BR /&gt;
&lt;BR /&gt;
How do i do that in .NET. I'm totally lost.&lt;BR /&gt;
&lt;BR /&gt;
Or even better, (look; Acad related) can i format a string the same way as&lt;BR /&gt;
using the %q formaters in ARX.&lt;BR /&gt;
i.e. let Acad format the strings according to the unit-settings&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;</description>
      <pubDate>Wed, 22 Nov 2006 15:17:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824908#M79793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-22T15:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824909#M79794</link>
      <description>"C# Text Manipulation Handbook - String Handling and Regular Expressions" by &lt;BR /&gt;
Wrox is going to be helpful.&lt;BR /&gt;
&lt;BR /&gt;
Microsoft has their hand in scientific computing now which should be &lt;BR /&gt;
researched for sophisticated math and calculus capabilities. Quite possibly &lt;BR /&gt;
the recent release of .NET 3.0 may have new classes for advanced &lt;BR /&gt;
calculations.&lt;BR /&gt;
&lt;BR /&gt;
&amp;lt;%= Clinton Gallagher&lt;BR /&gt;
         NET csgallagher AT metromilwaukee.com&lt;BR /&gt;
         URL http://clintongallagher.metromilwaukee.com/&lt;BR /&gt;
         MAP http://wikimapia.org/#y=43038073&amp;amp;x=-88043838&amp;amp;z=17&amp;amp;l=0&amp;amp;m=h&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:5404132@discussion.autodesk.com...&lt;BR /&gt;
.NET string formatting doesn't do angles and distances,&lt;BR /&gt;
so unless you need the more generic conversion, its not&lt;BR /&gt;
too helpful.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:5403763@discussion.autodesk.com...&lt;BR /&gt;
Brilliant. Just what I wanted.&lt;BR /&gt;
&lt;BR /&gt;
So I can fail to understand the .net string formatting for a couple of weeks&lt;BR /&gt;
more&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:5403635@discussion.autodesk.com...&lt;BR /&gt;
Not sure about the C++ equivalent, but you can use&lt;BR /&gt;
the Autodesk.AutoCAD.Runtime.Converter class in&lt;BR /&gt;
acdbmgd.dll to convert between distance/angle and&lt;BR /&gt;
strings.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:5403173@discussion.autodesk.com...&lt;BR /&gt;
Ok, this is not really an acad-related issue, but i'm doing an Acad-net app,&lt;BR /&gt;
so ....&lt;BR /&gt;
&lt;BR /&gt;
In c++ i format at string with dynamic precision using the formatstring&lt;BR /&gt;
"%.*f", m_sPrecision, x&lt;BR /&gt;
&lt;BR /&gt;
How do i do that in .NET. I'm totally lost.&lt;BR /&gt;
&lt;BR /&gt;
Or even better, (look; Acad related) can i format a string the same way as&lt;BR /&gt;
using the %q formaters in ARX.&lt;BR /&gt;
i.e. let Acad format the strings according to the unit-settings&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Wed, 22 Nov 2006 17:53:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824909#M79794</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-22T17:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824910#M79795</link>
      <description>All i really wanted was to specify the numbers of decimals dynamically.&lt;BR /&gt;
But this was very usefull.&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:5404132@discussion.autodesk.com...&lt;BR /&gt;
.NET string formatting doesn't do angles and distances,&lt;BR /&gt;
so unless you need the more generic conversion, its not&lt;BR /&gt;
too helpful.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:5403763@discussion.autodesk.com...&lt;BR /&gt;
Brilliant. Just what I wanted.&lt;BR /&gt;
&lt;BR /&gt;
So I can fail to understand the .net string formatting for a couple of weeks&lt;BR /&gt;
more&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:5403635@discussion.autodesk.com...&lt;BR /&gt;
Not sure about the C++ equivalent, but you can use&lt;BR /&gt;
the Autodesk.AutoCAD.Runtime.Converter class in&lt;BR /&gt;
acdbmgd.dll to convert between distance/angle and&lt;BR /&gt;
strings.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:5403173@discussion.autodesk.com...&lt;BR /&gt;
Ok, this is not really an acad-related issue, but i'm doing an Acad-net app,&lt;BR /&gt;
so ....&lt;BR /&gt;
&lt;BR /&gt;
In c++ i format at string with dynamic precision using the formatstring&lt;BR /&gt;
"%.*f", m_sPrecision, x&lt;BR /&gt;
&lt;BR /&gt;
How do i do that in .NET. I'm totally lost.&lt;BR /&gt;
&lt;BR /&gt;
Or even better, (look; Acad related) can i format a string the same way as&lt;BR /&gt;
using the %q formaters in ARX.&lt;BR /&gt;
i.e. let Acad format the strings according to the unit-settings&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Wed, 22 Nov 2006 21:27:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824910#M79795</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-22T21:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824911#M79796</link>
      <description>If I read the last post correctly, the solution is simpler than you would first expect. You can pass formatting arguments to the ToString() method of the Double class/datatype.&lt;BR /&gt;
&lt;BR /&gt;
Forgive the following, as I'm more used to C# than C++:&lt;BR /&gt;
&lt;BR /&gt;
double x = 12345.67;&lt;BR /&gt;
string s = x.ToString("N4"); //s is now "12,345.6700"&lt;BR /&gt;
&lt;BR /&gt;
See http://msdn2.microsoft.com/en-us/library/dwhawy9k.aspx for more info.</description>
      <pubDate>Thu, 23 Nov 2006 00:27:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824911#M79796</guid>
      <dc:creator>jbooth</dc:creator>
      <dc:date>2006-11-23T00:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824912#M79797</link>
      <description>But how do I change the 4 to a 5 depending on, for example, LUPREC ?&lt;BR /&gt;
(ok, this has again left the autocad relationship)&lt;BR /&gt;
&lt;BR /&gt;
On way can be to create the format string in runtime and to use that string &lt;BR /&gt;
to format the string i wanted.&lt;BR /&gt;
But there must be a better way! Or... ?&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JASON booth=""&gt; wrote in message news:5404875@discussion.autodesk.com...&lt;BR /&gt;
If I read the last post correctly, the solution is simpler than you would &lt;BR /&gt;
first expect. You can pass formatting arguments to the ToString() method of &lt;BR /&gt;
the Double class/datatype.&lt;BR /&gt;
&lt;BR /&gt;
Forgive the following, as I'm more used to C# than C++:&lt;BR /&gt;
&lt;BR /&gt;
double x = 12345.67;&lt;BR /&gt;
string s = x.ToString("N4"); //s is now "12,345.6700"&lt;BR /&gt;
&lt;BR /&gt;
See http://msdn2.microsoft.com/en-us/library/dwhawy9k.aspx for more info.&lt;/JASON&gt;</description>
      <pubDate>Thu, 23 Nov 2006 06:47:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824912#M79797</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-23T06:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824913#M79798</link>
      <description>Matt&lt;BR /&gt;
&lt;BR /&gt;
Look at&lt;BR /&gt;
Autodesk.AutoCAD.DatabaseServices.Database.get_Luprec()&lt;BR /&gt;
which returns an Int32&lt;BR /&gt;
&lt;BR /&gt;
also, Tony refered to Autodesk.AutoCAD.Runtime.Converter class in &lt;BR /&gt;
acdbmgd.dll&lt;BR /&gt;
.. it's actually in acmgd.dll .. but still in the Runtime Namespace so it &lt;BR /&gt;
will still work fine as quoted. .. no biggie.&lt;BR /&gt;
&lt;BR /&gt;
///&lt;BR /&gt;
kwb&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:5405016@discussion.autodesk.com...&lt;BR /&gt;
But how do I change the 4 to a 5 depending on, for example, LUPREC ?&lt;BR /&gt;
(ok, this has again left the autocad relationship)&lt;BR /&gt;
&lt;BR /&gt;
On way can be to create the format string in runtime and to use that string&lt;BR /&gt;
to format the string i wanted.&lt;BR /&gt;
But there must be a better way! Or... ?&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JASON booth=""&gt; wrote in message news:5404875@discussion.autodesk.com...&lt;BR /&gt;
If I read the last post correctly, the solution is simpler than you would&lt;BR /&gt;
first expect. You can pass formatting arguments to the ToString() method of&lt;BR /&gt;
the Double class/datatype.&lt;BR /&gt;
&lt;BR /&gt;
Forgive the following, as I'm more used to C# than C++:&lt;BR /&gt;
&lt;BR /&gt;
double x = 12345.67;&lt;BR /&gt;
string s = x.ToString("N4"); //s is now "12,345.6700"&lt;BR /&gt;
&lt;BR /&gt;
See http://msdn2.microsoft.com/en-us/library/dwhawy9k.aspx for more info.&lt;/JASON&gt;&lt;/NOSPAM&gt;</description>
      <pubDate>Thu, 23 Nov 2006 07:28:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824913#M79798</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-23T07:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824914#M79799</link>
      <description>You can dynamically format a numeric value by&lt;BR /&gt;
defining a class that implements the IFormatProvider&lt;BR /&gt;
interface, havin a GetFormat() member that returns&lt;BR /&gt;
an instance of a NumberFormatInfo object, whose&lt;BR /&gt;
members can specify formatting aspects such as the&lt;BR /&gt;
number of decimal places, and so forth.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message news:5405016@discussion.autodesk.com...&lt;BR /&gt;
But how do I change the 4 to a 5 depending on, for example, LUPREC ?&lt;BR /&gt;
(ok, this has again left the autocad relationship)&lt;BR /&gt;
&lt;BR /&gt;
On way can be to create the format string in runtime and to use that string &lt;BR /&gt;
to format the string i wanted.&lt;BR /&gt;
But there must be a better way! Or... ?&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JASON booth=""&gt; wrote in message news:5404875@discussion.autodesk.com...&lt;BR /&gt;
If I read the last post correctly, the solution is simpler than you would &lt;BR /&gt;
first expect. You can pass formatting arguments to the ToString() method of &lt;BR /&gt;
the Double class/datatype.&lt;BR /&gt;
&lt;BR /&gt;
Forgive the following, as I'm more used to C# than C++:&lt;BR /&gt;
&lt;BR /&gt;
double x = 12345.67;&lt;BR /&gt;
string s = x.ToString("N4"); //s is now "12,345.6700"&lt;BR /&gt;
&lt;BR /&gt;
See http://msdn2.microsoft.com/en-us/library/dwhawy9k.aspx for more info.&lt;/JASON&gt;&lt;/NOSPAM&gt;</description>
      <pubDate>Thu, 23 Nov 2006 07:50:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824914#M79799</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-23T07:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824915#M79800</link>
      <description>The converter does the job. Noprobs.&lt;BR /&gt;
This was just a generic question on how to use the ToString("N4"); to fit my &lt;BR /&gt;
needs.&lt;BR /&gt;
&lt;BR /&gt;
Case closed&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Kerry Brown" &lt;KWB&gt; wrote in message &lt;BR /&gt;
news:5405026@discussion.autodesk.com...&lt;BR /&gt;
Matt&lt;BR /&gt;
&lt;BR /&gt;
Look at&lt;BR /&gt;
Autodesk.AutoCAD.DatabaseServices.Database.get_Luprec()&lt;BR /&gt;
which returns an Int32&lt;BR /&gt;
&lt;BR /&gt;
also, Tony refered to Autodesk.AutoCAD.Runtime.Converter class in&lt;BR /&gt;
acdbmgd.dll&lt;BR /&gt;
.. it's actually in acmgd.dll .. but still in the Runtime Namespace so it&lt;BR /&gt;
will still work fine as quoted. .. no biggie.&lt;BR /&gt;
&lt;BR /&gt;
///&lt;BR /&gt;
kwb&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message&lt;BR /&gt;
news:5405016@discussion.autodesk.com...&lt;BR /&gt;
But how do I change the 4 to a 5 depending on, for example, LUPREC ?&lt;BR /&gt;
(ok, this has again left the autocad relationship)&lt;BR /&gt;
&lt;BR /&gt;
On way can be to create the format string in runtime and to use that string&lt;BR /&gt;
to format the string i wanted.&lt;BR /&gt;
But there must be a better way! Or... ?&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JASON booth=""&gt; wrote in message news:5404875@discussion.autodesk.com...&lt;BR /&gt;
If I read the last post correctly, the solution is simpler than you would&lt;BR /&gt;
first expect. You can pass formatting arguments to the ToString() method of&lt;BR /&gt;
the Double class/datatype.&lt;BR /&gt;
&lt;BR /&gt;
Forgive the following, as I'm more used to C# than C++:&lt;BR /&gt;
&lt;BR /&gt;
double x = 12345.67;&lt;BR /&gt;
string s = x.ToString("N4"); //s is now "12,345.6700"&lt;BR /&gt;
&lt;BR /&gt;
See http://msdn2.microsoft.com/en-us/library/dwhawy9k.aspx for more info.&lt;/JASON&gt;&lt;/NOSPAM&gt;&lt;/KWB&gt;</description>
      <pubDate>Thu, 23 Nov 2006 07:56:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824915#M79800</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-23T07:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824916#M79801</link>
      <description>I must say that printf sounds a lot more simple&lt;BR /&gt;
But i maybee just old and grumpy&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:5405046@discussion.autodesk.com...&lt;BR /&gt;
You can dynamically format a numeric value by&lt;BR /&gt;
defining a class that implements the IFormatProvider&lt;BR /&gt;
interface, havin a GetFormat() member that returns&lt;BR /&gt;
an instance of a NumberFormatInfo object, whose&lt;BR /&gt;
members can specify formatting aspects such as the&lt;BR /&gt;
number of decimal places, and so forth.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:5405016@discussion.autodesk.com...&lt;BR /&gt;
But how do I change the 4 to a 5 depending on, for example, LUPREC ?&lt;BR /&gt;
(ok, this has again left the autocad relationship)&lt;BR /&gt;
&lt;BR /&gt;
On way can be to create the format string in runtime and to use that string&lt;BR /&gt;
to format the string i wanted.&lt;BR /&gt;
But there must be a better way! Or... ?&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JASON booth=""&gt; wrote in message news:5404875@discussion.autodesk.com...&lt;BR /&gt;
If I read the last post correctly, the solution is simpler than you would&lt;BR /&gt;
first expect. You can pass formatting arguments to the ToString() method of&lt;BR /&gt;
the Double class/datatype.&lt;BR /&gt;
&lt;BR /&gt;
Forgive the following, as I'm more used to C# than C++:&lt;BR /&gt;
&lt;BR /&gt;
double x = 12345.67;&lt;BR /&gt;
string s = x.ToString("N4"); //s is now "12,345.6700"&lt;BR /&gt;
&lt;BR /&gt;
See http://msdn2.microsoft.com/en-us/library/dwhawy9k.aspx for more info.&lt;/JASON&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Thu, 23 Nov 2006 07:58:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824916#M79801</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-23T07:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824917#M79802</link>
      <description>If i unserstand it correct maybe this will help you.&lt;BR /&gt;
&lt;BR /&gt;
int Luprec = Application.DocumentManager.MdiActiveDocument.Database.Luprec;&lt;BR /&gt;
&lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
DistFPPrompt = DistFP.ToString("F" + Luprec.ToString());&lt;BR /&gt;
&lt;BR /&gt;
DistSPPrompt = DistSP.ToString("F" + Luprec.ToString());&lt;BR /&gt;
&lt;BR /&gt;
Dist = Math.Abs(DistSP - DistFP);&lt;BR /&gt;
&lt;BR /&gt;
DistPrompt = Dist.ToString("F" + Luprec.ToString());&lt;BR /&gt;
&lt;BR /&gt;
ed.WriteMessage(String.Format("\nabgewickelte Länge = {0}, erster Punkt = &lt;BR /&gt;
{1}, zweiter Punkt = {2}", DistPrompt, DistFPPrompt, DistSPPrompt));&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Roland Feletic&lt;BR /&gt;
Pauser ZT-GMBH&lt;BR /&gt;
http://www.pauser.at&lt;BR /&gt;
&lt;BR /&gt;
hp workstation xw4200, 3GB&lt;BR /&gt;
quadro fx1400&lt;BR /&gt;
AutoCAD 2007, 3DSMax 8.0 SP 2</description>
      <pubDate>Thu, 23 Nov 2006 08:47:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824917#M79802</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-23T08:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824918#M79803</link>
      <description>printf() ??  More simple?&lt;BR /&gt;
&lt;BR /&gt;
.NET is not simple because it utilizes an all-&lt;BR /&gt;
inclusive approach to solving problems like&lt;BR /&gt;
localization and so forth.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message news:5405029@discussion.autodesk.com...&lt;BR /&gt;
I must say that printf sounds a lot more simple&lt;BR /&gt;
But i maybee just old and grumpy&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:5405046@discussion.autodesk.com...&lt;BR /&gt;
You can dynamically format a numeric value by&lt;BR /&gt;
defining a class that implements the IFormatProvider&lt;BR /&gt;
interface, havin a GetFormat() member that returns&lt;BR /&gt;
an instance of a NumberFormatInfo object, whose&lt;BR /&gt;
members can specify formatting aspects such as the&lt;BR /&gt;
number of decimal places, and so forth.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Matt" &lt;NOSPAM&gt; wrote in message &lt;BR /&gt;
news:5405016@discussion.autodesk.com...&lt;BR /&gt;
But how do I change the 4 to a 5 depending on, for example, LUPREC ?&lt;BR /&gt;
(ok, this has again left the autocad relationship)&lt;BR /&gt;
&lt;BR /&gt;
On way can be to create the format string in runtime and to use that string&lt;BR /&gt;
to format the string i wanted.&lt;BR /&gt;
But there must be a better way! Or... ?&lt;BR /&gt;
&lt;BR /&gt;
/Matt&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JASON booth=""&gt; wrote in message news:5404875@discussion.autodesk.com...&lt;BR /&gt;
If I read the last post correctly, the solution is simpler than you would&lt;BR /&gt;
first expect. You can pass formatting arguments to the ToString() method of&lt;BR /&gt;
the Double class/datatype.&lt;BR /&gt;
&lt;BR /&gt;
Forgive the following, as I'm more used to C# than C++:&lt;BR /&gt;
&lt;BR /&gt;
double x = 12345.67;&lt;BR /&gt;
string s = x.ToString("N4"); //s is now "12,345.6700"&lt;BR /&gt;
&lt;BR /&gt;
See http://msdn2.microsoft.com/en-us/library/dwhawy9k.aspx for more info.&lt;/JASON&gt;&lt;/NOSPAM&gt;&lt;/TONY.TANZILLO&gt;&lt;/NOSPAM&gt;</description>
      <pubDate>Thu, 23 Nov 2006 22:14:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824918#M79803</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-23T22:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: String formatting in .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824919#M79804</link>
      <description>Look at the String.Format() methods: it has the sprintf formatting strings you're looking for.&lt;BR /&gt;
&lt;BR /&gt;
http://idunno.org/displayBlog.aspx/2004071401&lt;BR /&gt;
&lt;BR /&gt;
Bill Daly</description>
      <pubDate>Thu, 30 Nov 2006 07:24:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/string-formatting-in-net/m-p/1824919#M79804</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-30T07:24:12Z</dc:date>
    </item>
  </channel>
</rss>

