FLOAT(19,3) ZEROFILL : Float « Data Type « SQL / MySQL






FLOAT(19,3) ZEROFILL

    
mysql>
mysql> CREATE TABLE MEASUREMENTS (NO INTEGER,
    ->    MEASUREMENT_VALUE FLOAT(19,3) ZEROFILL);

mysql>
mysql> INSERT INTO MEASUREMENTS VALUES
    ->    (1, 99.99),
    ->    (2, 99999.99),
    ->    (3, 99999999.99),
    ->    (4, 99999999999.99),
    ->    (5, 99999999999999.99),
    ->    (6, 0.999999),
    ->    (7, 0.9999999),
    ->    (8, 99999999.9999),
    ->    (9, (1.0/3));
Query OK, 9 rows affected (0.00 sec)
Records: 9  Duplicates: 0  Warnings: 0

mysql>
mysql> SELECT * FROM MEASUREMENTS;
+------+---------------------+
| NO   | MEASUREMENT_VALUE   |
+------+---------------------+
|    1 | 000000000000099.990 |
|    2 | 000000000099999.992 |
|    3 | 000000100000000.000 |
|    4 | 000099999997952.000 |
|    5 | 100000000376832.000 |
|    6 | 000000000000001.000 |
|    7 | 000000000000001.000 |
|    8 | 000000100000000.000 |
|    9 | 000000000000000.333 |
|    1 | 000000000000099.990 |
|    2 | 000000000099999.992 |
|    3 | 000000100000000.000 |
|    4 | 000099999997952.000 |
|    5 | 100000000376832.000 |
|    6 | 000000000000001.000 |
|    7 | 000000000000001.000 |
|    8 | 000000100000000.000 |
|    9 | 000000000000000.333 |
+------+---------------------+
18 rows in set (0.00 sec)

mysql>
mysql> drop table MEASUREMENTS;
Query OK, 0 rows affected (0.00 sec)

   
    
    
    
  








Related examples in the same category

1.FLOAT(m, d): Floating-point number, 8-place accuracy (4 byte);
2.FLOAT(10,3)
3.Float type column type
4.A table definition that uses the DECIMAL and FLOAT data types.