Results 1 to 5 of 5

Thread: Rounding Error

  1. #1
    Join Date
    Aug 2003
    Posts
    8

    Exclamation Unanswered: Rounding Error

    I am having a hard time rounding a field to the nearest '10'.
    I can round it to the right of the decimal place, but when I try and round it to the left of the decimal place I get '#error' in the field.

    The expression that works is
    Strength: ROUND(([Compression_Test_Results]![Max_Load]/28.2743),1)

    The expression that gives me the error is
    Strength: ROUND(([Compression_Test_Results]![Max_Load]/28.2743),-1)

    Simpley putting the '-' in front of the "1" give me that error... am i doing something wrong? I don't understand why I am getting this error.

    Thanks for your help....

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    -1 makes a lot of sense to me, but apparently not to mr gates.

    you could try:
    Strength: 10* ROUND(([Compression_Test_Results]![Max_Load]/282.743),0)

    izy

  3. #3
    Join Date
    Aug 2003
    Posts
    23
    I'm not quite shure what you want to do, but this function will round to nearest 10, 28.2743 will be set to 3. <25 will be 2, >=25 will be rounded to 3.

    cint((YourNumber*100)/1000)

    hth

    /Svein Erik

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    ((YourNumber*100)/1000) = (YourNumber/10)
    ...except in the unfortunate case where (YourNumber*100) overflows

    cint() is an interesting alternative to round tho.

    cint equivalent to the ROUND example is:
    10*cint([Compression_Test_Results]![Max_Load]/282.743)

    izy

  5. #5
    Join Date
    Aug 2003
    Posts
    8

    It worked

    Worked great! Thanks...
    Ryan

Posting Permissions

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