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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding

Status
Not open for further replies.

Grunster

Technical User
Oct 26, 2003
4
0
0
GB
Please can somebody help me??!!

I have done the following calculation in a form:

3750*2.25%=84.375

I now want to minus this figure from the original £3750. This equals £3665.625 which is correct.

The problem I am having is that when I show the 2 values to 2 decimal places on comes out as £84.38 and the other £3665.63. This means that the figures look like they are 1p out.

Please can somebody help me to make Access round the first figure up before it subtracts it from the second (like the roundup function in Excel).

Thanks in advance
 
You may try something like this:
((3750*225+50)\100)/100

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Why not just use the Round function?

e.g.

round(3750*.0225,2)

will round to 2 decimal places.
Note that this is different for formatting to show 2 decimal places. The function will return the rounded number, so it should work in subsequent calculations.
 
Round has a special behaviour:
? Round(3.265,2), Round(3.275,2)
3.26 3.28

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
How are ya Grunster . . . . .

Considering a textbox with [blue]Percent Display Format[/blue] actually holds the [blue]displayed value/100[/blue], and [purple]returning only two decimals[/purple] (no other decimals to bump calculations):
Code:
[blue]Int((100*3750*PercentTextBox)+0.5)/100[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top