Solved

I need to always round up one sig digit

Posted on 2011-09-23
4
192 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
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…

828 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