I need help with this Sum

mrdata

Registered User.
Local time
Today, 05:34
Joined
May 26, 2006
Messages
32
I need to take these three numbers

24.0
25.0
25.3

Add them together
Divide answer by 3

and display answer in a textbox

in this format 24.7

What I have now adds the numbers divides by 3 but displays the answer
like this 24.766666

I am doing this in code with variables to store the numbers and the answer
But I can't get the format right when it rounds off it displays all the extra numbers in the equation
Thanks
Charles
 
The variable that you are using to hold the final calculation

in its properties you can set the number of decimal places
 
Follow up Question

SMART

How do I set the number of decimal places in the variable
Can you give me an example?
I tried a Format line but I must not be doing something right!

Thanks
Charles
 
If the variable is a field on the form
right click on the field select properties, set format to fixed and decimal places to 1
 

Users who are viewing this thread

Back
Top Bottom