Data.FmtBcd.TryStrToBcd

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: function
Visibility: public
Source:
Data.FmtBcd.pas
Data.FMTBcd.hpp
Unit: Data.FmtBcd
Parent: Data.FmtBcd

Delphi

function TryStrToBcd(const AValue: string; var Bcd: TBcd): Boolean;
function TryStrToBcd(const AValue: string; var Bcd: TBcd; const Format: TFormatSettings): Boolean;

C++

extern DELPHI_PACKAGE bool __fastcall TryStrToBcd(const System::UnicodeString AValue, TBcd &Bcd)/* overload */;

Description

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

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

TryStrToBcd converts the string specified by aValue and returns the resulting BCD value as Bcd.

TryStrToBcd returns true if it successfully converts aValue to a TBcd value. If aValue can't be successfully converted to a TBcd value, TryStrToBcd returns false.

See Also