Delphi Table Currency value to MySQL table $78.98 turns into $79.00?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
davidkennedy
Posts: 18
Joined: Fri 07 Jul 2006 16:21

Delphi Table Currency value to MySQL table $78.98 turns into $79.00?

Post by davidkennedy » Tue 11 Jul 2006 21:19

I am converting a Delphi table currency value into a MySQL table value. I've got the tables currency = true on the SQL table and have used the #.00 formatting string.
If I convert $78.98 to the MySQL table it comes out as $79.00. The MySQL field type is set as 'Decimal' as recommended in the MySQL help files.
Thank you.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 12 Jul 2006 13:34

Please report us what value you post to database, what value is stored in the database (you can check it using standard MySQL client) and what value is selected from database with MyDAC.
Also supply us following information
- Value of MyConnection.Options.NumericType option
- Exact version of Delphi, C++ Builder or Kylix
- Exact version of MyDAC. You can see it in About sheet of TMyConnection Editor
- Exact version of MySQL server and MySQL client. You can see it in Info sheet of TMyConnection Editor

davidkennedy
Posts: 18
Joined: Fri 07 Jul 2006 16:21

Newbee didn't decimal (7,2) set decimal places in the SQL schema

Post by davidkennedy » Wed 12 Jul 2006 14:21

I am guilty of not places the decimal places in the SQL schema. I have finished quite a substantial conversion process between Delphi tables and MySQL tables if anyone would like the code.
Thanks,
David

Post Reply