Recent

Author Topic: zeos + MySql + decimal(10.2) = problem in view. » resolved  (Read 8112 times)

krepe

  • Newbie
  • Posts: 3
zeos + MySql + decimal(10.2) = problem in view. » resolved
« on: November 22, 2009, 10:13:59 am »
I created a table in mysql fields with decimal (10,2).
lazarus configured the DisplayFormat =, 0.00, -, 0.00:
 - burn the fields as 8.58 ...
 - the database is 8:58
 - when I open the lazarus 858

I'm using zeos, and put the property zconnection :

   CHARSET = latin1
   COLLATE = latin1_general_cs

   equal to the bank.

open and appears in Delphi + zeos = 8.58

I tried everything on the Lazarus 0.9.28.2

At the base firebird appears: 8.58 in the preview.

someone has a hint or solution?

thank you for your attention.
hugs.
Krepe.

Translated by google.
« Last Edit: November 30, 2009, 01:57:53 am by krepe »

Mike J

  • Jr. Member
  • **
  • Posts: 54
  • Computer Programmer/www.NewsRx.com
    • ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ ᏗᏕᎶᏆᏍᏗ (Cherokee Language Lessons)
Re: zeos + MySql + decimal(10.2) = problem in view.
« Reply #1 on: November 22, 2009, 01:58:59 pm »
Create a single form example of the problem.
Attach the generated source code here.
Hopefully someone will be able to see better what is happening.
ᏙᎯ

krepe

  • Newbie
  • Posts: 3
Re: zeos + MySql + decimal(10.2) = problem in view.
« Reply #2 on: November 22, 2009, 03:12:03 pm »
I have 1 and 1 MySQL database table with the following fields:
Field Type Null Default Comments Links to MIME
fpes_id int (11) No
tab_id int (11) No
tar_id int (11) No rates -> tar_id
fpes_pesini int (11) No
fpes_pesfin int (11) No
fpes_tarifa decimal (10,2) not

lazarus have a Zconnection + Zquery + DataSource + DbGrid + DBNavigator

I record the field values fpes_tarifa = 4.18 or 7.26 or 0.08 ...
to update the table they appear 418.00 726.00 8.00

be the regional settings, here in Brazil is the decimal separator =,

This same example in a firebird database, the fields appear as you type 4.18 7.26 0.08

on screen:
laz1 = design time
laz2 = running (fields-Compliance)

after upgrading everything back to the screen design.

thank you.

krepe

  • Newbie
  • Posts: 3
Re: zeos + MySql + decimal(10.2) = problem in view.
« Reply #3 on: November 30, 2009, 01:56:31 am »
The solution was found in http://www.lazarus.freepascal.org/index.php/topic topic, 1970.0.html

in the field fpes_tarifa:

procedure TForm1.ZQuery1fpes_tarifaGetText(Sender: TField; var aText: string;
  DisplayText: Boolean);
begin
  aText := FormatFloat(TNumericField(Sender).DisplayFormat, Sender.AsInteger/100);
end;     

Thank jesusr

translated by goolge.

 

TinyPortal © 2005-2018