The TFieldType ftFMTBcd, is not aligned to the right

TeeGrid VCL / FMX for Embarcadero RAD Studio, Delphi, C++ Builder and Lazarus Free Pascal.
Post Reply
REH Outsourcing
Newbie
Newbie
Posts: 25
Joined: Tue Mar 13, 2018 12:00 am

The TFieldType ftFMTBcd, is not aligned to the right

Post by REH Outsourcing » Tue Jun 05, 2018 9:44 am

Delphi version: Seattle and Tokyo
TTeeGrid version: VCL & FMX Registered version-1.04
Multidevice Application (FMX)
Platform: WIN32

Good morning,

The solution is In Tee.GridData.DB:

Code: Select all

// Returns the appropiate horizontal text alignment, depending on AField data type
class function TVirtualDBData.HorizAlignOf(const AField:TField):THorizontalAlign;
begin
  case AField.DataType of
    {$IFNDEF FPC}
    ftShortInt,
    {$ENDIF}
    ftSmallint,
    ftInteger,
    ftWord,
    ftAutoInc,
       {REH:FIX}
       ftFMTBcd, <---
       {REH:FIX}
    {$IFNDEF FPC}
    ftByte,
    {$ENDIF}

    {$IFNDEF FPC}
    ftLongWord,
    {$ENDIF}
    ftLargeint,

    ftDate,
    ftTime,
    ftDateTime,

    ftCurrency,

    {$IFNDEF FPC}
    {$IF CompilerVersion>20}
    ftSingle,
    {$IFEND}
    {$ENDIF}

    ftFloat : result:=THorizontalAlign.Right;

  else
    result:=THorizontalAlign.Left;
  end;
end;

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: The TFieldType ftFMTBcd, is not aligned to the right

Post by Yeray » Fri Jun 08, 2018 7:49 am

What about ftBCD? I guess it should do the same than ftFMTBcd.

Thanks for sharing!
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

REH Outsourcing
Newbie
Newbie
Posts: 25
Joined: Tue Mar 13, 2018 12:00 am

Re: The TFieldType ftFMTBcd, is not aligned to the right

Post by REH Outsourcing » Fri Jun 08, 2018 8:00 am

Buenos días Yeray,

This is what the Embarcadero documentation says:
ftBCD Binary-coded Decimal field that can be converted to Currency without loss of precision.

Therefore I imagine that aligning it to the right is appropriate.

Saludos.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: The TFieldType ftFMTBcd, is not aligned to the right

Post by Yeray » Fri Jun 08, 2018 1:36 pm

Hola,

Yes. I've added both changes to the sources so the next maintenance release will include them.

Gracias!
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply