问题
Possible Duplicate:
Is there a way to programmatically convert VB6 Formatting strings to .NET Formatting strings?
during migration from vb6 to vb.net the Format$(1234567, "###,###,###,###") function is converted to vb6.Format(1234567,"###,###,###,###") function, which is defined in Microsoft.Visualbasic.Compatibility.dll.
I dont want to use Microsoft.Visualbasic.Compatibility.dll. Is there any equivalent for this in .NET.
Thanks in advance.
回答1:
You can use the .ToString(string) method
Dim value As Integer = 1234567
value.ToString("###,###,###,###")
or the String.Format Method which uses Composite Formatting
String.Format("{0:###,###,###,###}", 1234567)
来源:https://stackoverflow.com/questions/14133762/equivalent-for-vb6-format-function-in-vb-net-without-using-microsoft-visualbasic