Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Decimal places (2003)

    I have a text box control on a form bound to a field of type Long Integer.
    I am trying to input a value of 6.5 - when I do this it is rounded down to 6. If I put in 6.6 it is rounded up to 7. Both of these are integer values and are what is stored in the table.
    I have looked at the properties help and it appears to say that I should set the format to General Number; I've tried but the result is as described above.
    What must I do in order to be able to input this value, have it stay displayed as 6.5 and stored as 6.5 in the table field, please?
    Thanks
    Silverback
    Silverback

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Decimal places (2003)

    "Integer" means "whole number", so your field cannot store decimal places. In order to store decimal places, you must change the field size of the field to Single or Double. If the field is used to store currency amounts, you can also use Currency as data type.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Decimal places (2003)

    Hmmm - yes, I guessed that it was the wrong option to try and store a number with decimal places in an integer field, but I couldn't - and still can't - find out any information about what a single and double type is.
    Because the format field had examples of numbers with decimal places, and format help said in the description of General Number "Display the number as entered", I spent my time playing around with format and decimal places - obviously to no avail.
    Anyway, once again you have got me out of a hole, for which many thanks. Are single/double floating point numbers ?
    Thanks
    Silverback
    Silverback

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Decimal places (2003)

    If you search the Access help for Field Size, you'll get information about the various number types.

    Single and Double are indeed both floating point numbers.
    A single precision number takes up 4 bytes and offers up to 7 significant digits.
    A double precision number takes up 8 bytes and offers up to 15 significant digits.

Posting Permissions

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