RAD Studio VCL Reference
SysUtils.StrToCurr Function

Converts a string to a System::Currency value.

function StrToCurr(const S: string): Currency; overload;
function StrToCurr(const S: string; const FormatSettings: TFormatSettings): Currency; overload;
Currency StrToCurr(const AnsiString S);
Currency StrToCurr(const AnsiString S, const TFormatSettings FormatSettings);

Call StrToCurr to convert a string that represents a floating-point value to the corresponding System::Currency value. The source string, S, must consist of an optional sign (+ or -), a string of digits with an optional decimal point, and an optional 'E' or 'e' followed by a signed integer. Leading and trailing blanks are ignored.  

Thousand separators and currency symbols are not allowed in the string. If the string doesn't contain a valid value, StrToCurr raises an EConvertError exception. 

The first form of StrToCurr is not thread-safe, because it uses localization information contained in global variables. The second form of StrToCurr, which is thread-safe, refers to localization information contained in the FormatSettings parameter. Before calling the thread-safe form of StrToCurr, you must populate FormatSettings with localization information. To populate FormatSettings with a set of default locale values, call GetLocaleFormatSettings


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!