Round(10773.31)
Round(10775.55)
Round(10778.55)
i want like 10780 in linq or .net
any one help me please
Round() in .net
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Apr 8, 2011, 8:12 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Apr 8, 2011, 12:31 PM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 8, 2011, 12:51 PM EDT
As you'll see I answered it (hopefully correctly) in a similar way to what Sam has just described.
CrishRank #1,486 · 1.1K reputationPosted Apr 9, 2011, 12:55 AM EDT
d=10773.31;
public static double RealRound(double d, int decimals)
{
return Math.Round(d + decimals/10.0, decimals);
}
piyush sardhara177 reputationPosted Apr 9, 2011, 1:17 AM EDT