✅ need quick help how to print 2 decimals

how can i print double numbers using {0:f2} in this case?
No description
7 Replies
474122955031314442
474122955031314442OP12mo ago
or any other way, i want to show "numbers are:" only once
Kouhai
Kouhai12mo ago
arr[i].ToString("f2")
Seoner
Seoner12mo ago
or Console.WriteLine(string.Format("{0:f2}", arr[i]));
474122955031314442
474122955031314442OP12mo ago
so it must become a string?
Seoner
Seoner12mo ago
Hover over WriteLine it's a method that requires a string, so you have to pass it a string, not a double, some methods might be overloaded (they have the same syntax but requires diffrent parameters) in case there is a overloaded method that can receive argument of your variable type, you don't have to parse
474122955031314442
474122955031314442OP12mo ago
whoops lol thank you!
MODiX
MODiX12mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server