Solved

Performing calculations

Posted on 2006-07-21
3
155 Views
Last Modified: 2010-04-23
Hello experts:

I'm creating an input form that performs some computations and displays the answer to the user.  What data type would you suggest I use to compute this calculations.  It is pretty much straight up addition with some multiplication and division and does need to be rounded to 2 decimal places.

Thanks
0
Comment
Question by:escheider
3 Comments
 
LVL 18

Accepted Solution

by:
Ravi Singh earned 25 total points
ID: 17156462
You can use the Double data type, and use the Math.Round method for rounding to two decimal places
0
 
LVL 24

Assisted Solution

by:Jeff Certain
Jeff Certain earned 25 total points
ID: 17156558
If you only need 2 decimal places, Single will give you a slight benefit in memory requirements -- assuming that your results won't be more than +/- 3.4x10^38.

However, the trade-off will be slower performance, since double is the processor-native floating point type.
0
 
LVL 4

Author Comment

by:escheider
ID: 17156599
Thank you very much......
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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, f…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 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

15 Experts available now in Live!

Get 1:1 Help Now