Solved

Performing calculations

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

14 Experts available now in Live!

Get 1:1 Help Now