✅ Code for 2dp
Whats the code that allows you to multiply two numbers and then add them e.g. (1.20 x 2) + (2.40 x 3) and then results in the answer outputting at 2dp instead of a whole number?
9 Replies
Huh?
what is 2dp?
decimal points?
yeah
that's not part of the math, that's part of the output formatting
oh yeah thats what i meant
like
Console.WriteLine($"{result:F2}");
uhhh
i think that was it?
Standard numeric format strings - .NET
In this article, learn to use standard numeric format strings to format common numeric types into text representations in .NET.
oooo ok ill have a look thanks!