Rounding down the 54th power

  • Thread starter Thread starter Fire Chief
  • Start date Start date
F

Fire Chief

I have tried to use all the round functions i.e. round () Rnd() etc and I
can not get it to work like I want it to. This is a program that calculates
fire hydrant pressures and Gallons per minute flowed.

Here is the code for a textbox in question.

Private Sub PowerAnswer1_Click()
PowerAnswer1 = Answer1 ^ 0.54
End Sub

Work great except I get 12 or more numbers, I just want to see the first
six.

Can someone help, Thanks in advance

Ed White
 
I have tried to use all the round functions i.e. round () Rnd() etc and I
can not get it to work like I want it to. This is a program that calculates
fire hydrant pressures and Gallons per minute flowed.

Here is the code for a textbox in question.

Private Sub PowerAnswer1_Click()
PowerAnswer1 = Answer1 ^ 0.54
End Sub

Work great except I get 12 or more numbers, I just want to see the first
six.

Try

PowerAnswer1 = Val(Format([Answer1] ^ 0.54, "#.000000"))

The Format function will convert the value to a String, and Val back
into a number.


John W. Vinson[MVP]
 
Thanks John that was actually what I needed.
Ed

John Vinson said:
I have tried to use all the round functions i.e. round () Rnd() etc and I
can not get it to work like I want it to. This is a program that
calculates
fire hydrant pressures and Gallons per minute flowed.

Here is the code for a textbox in question.

Private Sub PowerAnswer1_Click()
PowerAnswer1 = Answer1 ^ 0.54
End Sub

Work great except I get 12 or more numbers, I just want to see the first
six.

Try

PowerAnswer1 = Val(Format([Answer1] ^ 0.54, "#.000000"))

The Format function will convert the value to a String, and Val back
into a number.


John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top