Results 1 to 5 of 5

Thread: Decimal places

  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a report that I can't shorten the number of decimal places on it. I have set the text box and both queries that create the report to fixed format and 1 decimal places. But I keep getting anywhere from 1 to 8 decimal places. Any ideas? What is the obvious thing that I am missing? Thank you. Fay

  2. #2
    Star Lounger
    Join Date
    Dec 2009
    Location
    Mexico City, D.F., Mexico
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It seems that you are changing the display of the numbers, not their values. Use functions like Round() or Int() -- Int(MyNumber*10+0.5)/10 rounds a number to its first decimal for example. Depending on your database engine, the names of the functions may be different.
    This eco-post is made of recycled electrons

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Try setting the Format property of the controls on the report to Fixed, then specifying the desired number of decimal places.
    Regards
    John



  4. #4
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you Stephane the int worked. I appreciate your help. Fay

    Quote Originally Posted by Stephane Quenson View Post
    It seems that you are changing the display of the numbers, not their values. Use functions like Round() or Int() -- Int(MyNumber*10+0.5)/10 rounds a number to its first decimal for example. Depending on your database engine, the names of the functions may be different.

  5. #5
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you John. I had used this approach without success. It worked with the queries, but didn't work on the report. Go figure why the numbers would change layout from what the query reported to the report. Finally used the suggestion from Staphane and got the report to work correctly. Fay
    Quote Originally Posted by John Hutchison View Post
    Try setting the Format property of the controls on the report to Fixed, then specifying the desired number of decimal places.

Posting Permissions

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