Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String.Format
Message
 
 
To
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:
01576040
Views:
50
>>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();
>		}
>
>
>
>
Thanks again.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform