Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiplication Problem

Status
Not open for further replies.

Anaheim23

Technical User
Joined
Jun 29, 2006
Messages
8
Location
US
I want to make my form do math, however, I want it NOT to round up my number to the nearest one. For example I needed it to calculate (7)(25.90%). The correct answer is 1.813, however, it rounded that number up to 2. Any way I can do this?
 
The answer being rounded means that your answer is defined/declared somewhere (can't tell from your post) as
Long (integer). It needs to be defined as Single(Precision).
I think (not on a PC with Access, so I can't check) that Long is the default for a number, so you may not have deliberately chosen it.

For example:

Dim Numb as Long

Numb = 7

Numb * .2590 = 2

While:

Dim Numb as Single

Numb = 7

Numb * .2590 = 1.813

If you're saving the calculated result to a table, the field may be defined in the table as a "Long" instead of a "Single"




The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
Thanks missinglinq! I found that using single works out. I also found out that if I changed it to currency, it'll also keep my numbers from being rounded.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top