Languages
[Edit]
EN

C# / .NET - Math.Round() method example

0 points
Created by:
Zeeshan-Peel
850

Math.Round is a static method that returns a number that is rounded to the closest integer number.


1. Documentation

Edit

Syntax

Edit

 

SyntaxSyntax example is above.
Parameters

d - decimal value to round.

value - double value to round.

precision - number of decimal places to which we want to round.

ResultRounded number value (primitive value).
DescriptionRound is a static method that returns a number that is rounded to the closest integer number.

2. Custom round method examples

Edit

2.1. Rounding with precision to n places example

Edit

This section contains a custom function that shows how to round number with precision to n places.

2.2. Round implementation example

Edit

This section contains custom round function implementation.

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

C# / .NET - Math object

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join