RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
FMTBcd.StrToBcd Function

Converts a string to the corresponding binary-coded decimal (BCD) value.

Pascal
function StrToBcd(const AValue: string): TBcd;
C++
TBcd StrToBcd(const AnsiString AValue);

FMTBcd

Use StrToBcd to convert a string into a binary-coded decimal value. The decimals and precision are inferred from the digits present in the string. 

StrToBcd converts the string specified by aValue and returns the resulting BCD value. If aValue does not represent a value that can be expressed as a TBcd, StrToBcd raises an exception.

Tip: To convert a string to a Bcd value without raising an exception for invalid strings, use the TryStrToBcd function instead.
 

 

BcdToStr 

BcdToStrF 

FormatBcd 

TryStrToBcd

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!