Solved

I need to always round up one sig digit

Posted on 2011-09-23
4
189 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
Comment Utility
Yes, that will work.
0
 

Author Comment

by:newbieweb
Comment Utility
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
Comment Utility
>> 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
Comment Utility
Thanks!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now