BcdUnit
From Free Pascal wiki
Jump to navigationJump to searchWelcome
Welcome to information page about FMTBcd. Goal of this page is to contain information needed for implementing FPC version of the FMTBcd.
FMTBcd unit defines a number of binary-coded decimal (BCD) routines (find the source in ..\Delphi6\Source\Vcl):
Types
TBcd = packed record Precision: Byte; SignSpecialPlaces: Byte; Fraction: packed array [0..31] of Byte; end;
pbcd will probably be a pointer to tbcd
signspecialplaces and 63 = amount of decimal MINUS a still unknown number of default digits.
The bit with value 128 probably is the signbit.
Const
NullBcd
what is the NullBcd? is it a zero or invalid number?
Exceptions
EBcdException, EBcdOverflowException
??
EBcdException = Class(Exception); EBcdOverflowException = Class(Exception);
Utility
BcdPrecision, BcdScale, IsBcdNegative
??
Arithmetic
BcdAdd, BcdSubtract, NormalizeBcd, BcdMultiply (8 overloads)
Creation
VarFMTBcdCreate (5 overloads), VarIsFMTBcd, VarFMTBcd
Conversions
StrToBcd, TryStrToBcd, DoubleToBcd, DoubleToBcd, IntegerToBcd, VarToBcd, CurrToBCD, BcdToStr, BcdToDouble, BcdToInteger, BCDToCurr, BcdToStrF, FormatBcd, BcdCompare
Resources
only usable resource returned by google shows: http://homepages.borland.com/efg2lab/Library/Delphi/MathInfo/