Announcement

Collapse
No announcement yet.

can't use the decimals!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • can't use the decimals!

    hi guys, how to make a field write 444.32 ? i tried decimal and INT but couldn't reach this number, in SC field decimal used "Decimal Precision =2" but doesn't allow to write more than x.xx

    first time to work with decimals, is it a bug or I'm missing something?

  • #2
    Hey Mike:

    set your precision= 2 and select the option "complete with zeros" , oh and don't forget to set your field's max size.

    Regards =D

    Comment


    • #3
      i'm going crazy here, can't write more than one digit! and 2 dicimals
      i put max size 6 field size 6
      and minimum 0.00
      maximum 555.00

      but i cant type in the field other than 1 digit nothing else, one digit as integer and dot (.) 2 decimals nothing more!!!!

      Comment


      • #4
        I had this once before, but can't remember what I did to solve it. Must be Alzheimer.
        I thought I let you know just to cheer you up a bit.

        jsb

        Comment


        • #5
          oh! I'm definetely cheered up dude
          I will add it to bugs, perhaps they solve it in 2015
          meanwhile will use varchar, please let me know if you remember the fix
          by the way, can't we use decimal if put use type: integer? just asking... also while i was reading about decimal, double and other, i read about assigned/unassigned but couldn't understand it, is it related to our case here?! grrrrrrr
          Last edited by MikeDE; 02-15-2015, 12:05 AM.

          Comment


          • #6
            okay, i think i got it, removed the field completely from mysql/phpmyadmin and re-created it directly as decimal 6,2 it worked
            barthoooooooooo

            jsb dude i colored a part above in red, really curious how you can define that in your kingdom
            Last edited by MikeDE; 02-15-2015, 12:06 AM.

            Comment


            • #7
              No you can't use type integer to store a decimal value. As the name suggests it is for integer values. (1 or 2 or 10365).
              The decimal type is what you will need most if not in all (unless you are doing something for the scientific world) of your projects
              when tackling numbers with a fractional part. You declare the size including the decimal point and the decimal part.

              DEC(5,3) would give you i.e. 1.234 (5 is the total no. of characters including the decimal point, and 3 is the no. of digits to follow the decimal.)

              Float and double are so called floating point and mostly used in science to express ridiculous huge numbers, like the diameter of a galaxy in mm. :-)

              Signed (standard) and unsigned is to define if your field can store only positive (unsigned) values or negative (signed) values as well.
              The difference is in the value range because of the negative sign which has to be stored or not with the value.
              For example: TINYINT gives you a range 256 numbers, 0 to 255 (unsigned) or -128 to +127 (signed).

              I hope I could shed some light of the mysterious world of data types. :-)

              jsb

              Comment


              • #8
                Indeed! you covered this point nicely like when wikipedia fairly covers the topic for everyone and highlights the whole idea, yet as simple as possible & all-in-one.

                I'm sure many many people will find this useful to know or to complete their knowledge about this subject.

                God bless you.
                Last edited by MikeDE; 02-15-2015, 12:56 PM.

                Comment

                Working...
                X