System.SysUtils.StrToCurrDef
Delphi
function StrToCurrDef(const S: string; const Default: Currency): Currency;
function StrToCurrDef(const S: string; const Default: Currency; const AFormatSettings: TFormatSettings): Currency;
C++
extern DELPHI_PACKAGE System::Currency __fastcall StrToCurrDef(const System::UnicodeString S, const System::Currency Default)/* overload */;
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
説明
文字列を Currency 値に変換し、デフォルト エラーを合わせて返します。
StrToCurrDef を呼び出すと、浮動小数点値を表す文字列を、対応する Currency 値に変換することができます。 ソース文字列の S
は、+ または - の符号(任意)、小数点(任意)を含む数字の文字列、および、符号付整数に先行する 'E' または 'e'(任意)で構成されている必要があります。 前後にある空白は無視されます。
文字列に、桁区切り文字および通貨シンボルは使用できません。 文字列に有効な値が含まれていない場合は、StrToCurrDef は、Default
を返します。
StrToCurrDef の第 1 の形式は、グローバル変数に含まれているローカライズ情報を使用するため、スレッド セーフではありません。 StrToCurrDef の第 2 の形式は、AFormatSettings
パラメータに含まれているローカライズ情報を参照し、スレッド セーフです。 StrToCurrDef のスレッド セーフ形式を呼び出す前に、AFormatSettings
にローカライズ情報を入れる必要があります。 AFormatSettings
にデフォルトのローカル値セットを入れるには、TFormatSettings.Create を呼び出します。