Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String.Format
Message
From
18/02/2013 12:13:03
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01566272
Message ID:
01566279
Views:
64
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>Do you know how this VFP format
>
>
>transform(extension, '$,$$$,$$9.99')
>
>translates into StringBuilder AppendFormat ?
>
>Thanks in advance.

Try this - replace 20 with the length you need
	static void Main()
		{

			decimal[] values = {
								   11211105.99m,
								   0m, 
								   1m
							   };

			foreach (decimal x in values)
				Console.WriteLine("{0,20:$#,##0.00}", x);
			

			StringBuilder sb = new StringBuilder();
			sb.AppendFormat("{0,20:$#,##0.00}",  11211105.99m);
			Console.WriteLine(sb.ToString());
			Console.ReadLine();
		}
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform