Forum Moderators: open
Please advice!
Lacking any other information, I would use some sort of numeric field- whichever one has the highest precision that you'll need.
[edited by: LifeinAsia at 11:05 pm (utc) on April 30, 2009]
And I MUST store the number exactly as it will be provided.
Again, without more information about why you have to store things like that or what kind of comparison, I can't offer better advice.
create table test (id int(11) not null primary key auto_increment, int_fld int(25) not null, dec_fld decimal (100,25));
insert into test (int_fld,dec_fld) values ('123','123');
insert into test (int_fld,dec_fld) values ('-123','-123');
insert into test (int_fld,dec_fld) values ('-45.74423','-45.74423');
insert into test (int_fld,dec_fld) values ('23e-56','23e-56');
select * from test;
+-------+----------+--------------------------------+
¦..id...¦..int_fld.¦......dec_fld...................¦
¦..1....¦......123.¦...123.0000000000000000000000000¦
¦..2....¦.....-123.¦..-123.0000000000000000000000000¦
¦..3....¦-45.74423.¦..-45.74423000000000000000000000¦
¦..4....¦.......23.¦.....0.0000000000000000000000000¦
+-------+----------+--------------------------------+
You'd likely want to do right-side trimming of zeros, but a little programming in the recipe should cook it up nice.