Float doesn't go past 100

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashraf02
    New Member
    • Feb 2008
    • 53

    Float doesn't go past 100

    i have set my clothes price field to float datatype at(4,2) it doesn't let me exceed 100 it comes up with 99.99 i must be doin something stupid can some one please help.
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Run the following query and post the result here.
    [CODE=mysql]SHOW CREATE TABLE tablename;[/CODE]

    Comment

    • ashraf02
      New Member
      • Feb 2008
      • 53

      #3
      CREATE TABLE Clothes (
      Clothes_ID int not null primary key auto_increment,
      Type_ID int not null,
      Clothes_Brand varchar (30) not null,
      Clothes_Type varchar (80) not null,
      Clothes_Colour varchar (30),
      Clothes_Price float (4,2) not null,
      Clothes_Image varchar (150),
      Clothes_Descrip tion text);

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        You defined it as 4 in total length of which 2 decimals, so 99.99 is the maximum.
        Originally posted by mysql doc
        MySQL allows a non-standard syntax: FLOAT(M,D) or REAL(M,D) or DOUBLE PRECISION(M,D). Here, “(M,D)” means than values can be stored with up to M digits in total, of which D digits may be after the decimal point
        Ronald

        Comment

        • ashraf02
          New Member
          • Feb 2008
          • 53

          #5
          Thanx ronald i get it now.

          Comment

          • ronverdonk
            Recognized Expert Specialist
            • Jul 2006
            • 4259

            #6
            Okay, see you next time.

            Ronald

            Comment

            Working...