Format(rs.Fields(1), "#,###.00000") to C#

52 views Asked by At

I'm converting some VBA code from Excel macro into C# and came across with this line of code.

VBA:

Format(12356, "#,###.00000")

How to translate this to C#?

1

There are 1 answers

0
Prasad Telkikar On BEST ANSWER

You can try, ToString() with same format.

var numStr = 12356.ToString("#,###.00000");
Console.WriteLine(numStr);  //"12,356.00000"

.Net Fiddle