Results 1 to 4 of 4

Thread: Division results in 8.32957075464354E-03

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2005
    Location
    Wisconsin
    Posts
    788

    Division results in 8.32957075464354E-03

    Here is the equation:
    401.25 / 48171.75
    this results in this:
    8.32957075464354E-03
    how do I get the correct number which is: 120.05420560....
    The total number is 28 decimals long. Basically I need 4 to 8 decimal places. I tried some different rounding functions I found but to no avail.


    thanks

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: Division results in 8.32957075464354E-03

    Quote Originally Posted by mojo69 View Post
    how do I get the correct number which is: 120.05420560....
    Microsoft Calculator's result for 401.25 / 48171.75 is: 0.0083295707546435410795746469663236

    Quote Originally Posted by mojo69 View Post
    The total number is 28 decimals long. Basically I need 4 to 8 decimal places. I tried some different rounding functions I found but to no avail.
    Have you tried the Round function?

    Code:
    Round(401.25 / 48171.75, 8)
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Division results in 8.32957075464354E-03

    Er, there is no way that dividing a smaller number by a larger number is going to give a value of 1 or greater.

    You have the two values reversed in your expression.

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Division results in 8.32957075464354E-03

    Definitely backwards
    Code:
    Debug.Print 48171.75 / 401.25
    Yeilds 120.054205607477

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width