Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

I need to always round up one sig digit

I need 2.32 to always round to 2.4.

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


Thanks.
0
newbieweb
Asked:
newbieweb
  • 2
  • 2
2 Solutions
 
Todd GerbertIT ConsultantCommented:
Yes, that will work.
0
 
newbiewebAuthor Commented:
Are there any uninteded consequences? Like making a number round too much?

Is this consider best practice? Any other ways?
0
 
Todd GerbertIT ConsultantCommented:
>> 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
 
newbiewebAuthor Commented:
Thanks!
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now