Solved

Performing calculations

Posted on 2006-07-21
3
158 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…

792 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