Importing CSV and numbers losing Zero's
Moderator: General Moderators
Importing CSV and numbers losing Zero's
I have a CSV files with a column of prices e.g.
1.20
1.30
1.40
1.50
but when i import them into my MySQL database using SQLyog, the figures now look like this
1.2
1.3
1.4
1.5
How do i stop this from happening?
Mark
1.20
1.30
1.40
1.50
but when i import them into my MySQL database using SQLyog, the figures now look like this
1.2
1.3
1.4
1.5
How do i stop this from happening?
Mark
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
its being dropped and recreated
Thats the code that is being used to generate the table
Mark
Code: Select all
create table `pricelist`.`generics` (
`code` varchar (50) NULL ,
`product` varchar (50) NULL ,
`quantity` varchar (10) NULL ,
`a` double NULL ,
`b` double NULL ,
`d` double NULL
);Mark
When you create your field you need to use :
where X is int, Y is amount of decimals.
If you set Y to 2, your loosing zeros problem will be solved.
Code: Select all
DOUBLE (X,Y)If you set Y to 2, your loosing zeros problem will be solved.