TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
eliza sahoo
NA
41
0
MidPointRounding for Math.Round() method in .Net Application
Mar 24 2010 7:06 AM
We all know Math.Round() basically rounds a particular decimal value. But if we look into this method closely it rounds the value to the nearest even value.
For example if we do
Math
.Round(2.5,0) it will return 2. But we may expect 3 intead of 2. In that case we can use MidPointRounding parameter of
Math.Round() method.
Math.Round can also take a parameter known as
MidPointRounding
which helps us to select the Rounding option. That means whether we want to round towards even number or to the number away from zero.
For example, when someone do the rounding of 8.5 .
MidpointRounding
will help to specify whether rounding will be towards the even number (8) or it will be away from zero (9).
Reply
Answers (
1
)
Send email through the proxy server?
how to call a static function of class Form?