Solved

I need to always round up one sig digit

Posted on 2011-09-23
4
191 Views
Last Modified: 2012-05-12
I need 2.32 to always round to 2.4.

Wil this work?
decimal minAllowedAmount = decimal.Round(minAmount+0.05M, 1);


Thanks.
0
Comment
Question by:newbieweb
  • 2
  • 2
4 Comments
 
LVL 33

Assisted Solution

by:Todd Gerbert
Todd Gerbert earned 500 total points
ID: 36588442
Yes, that will work.
0
 

Author Comment

by:newbieweb
ID: 36588454
Are there any uninteded consequences? Like making a number round too much?

Is this consider best practice? Any other ways?
0
 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 500 total points
ID: 36588521
>> Are there any uninteded consequences? Like making a number round too much?
Nope.


>> Is this consider best practice? Any other ways?
I can't be absolutely, positively, 100% certain - but I'm pretty sure (99.99%) - that's the only way to do it.
0
 

Author Closing Comment

by:newbieweb
ID: 36588539
Thanks!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question