Page 1 of 1

The TFieldType ftFMTBcd, is not aligned to the right

Posted: Tue Jun 05, 2018 9:44 am
by 18683216
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;

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

Posted: Fri Jun 08, 2018 7:49 am
by yeray
What about ftBCD? I guess it should do the same than ftFMTBcd.

Thanks for sharing!

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

Posted: Fri Jun 08, 2018 8:00 am
by 18683216
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.

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

Posted: Fri Jun 08, 2018 1:36 pm
by yeray
Hola,

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

Gracias!