SysUtils.TryStrToCurr

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From SysUtils.pas

	function TryStrToCurr(const S: string; out Value: Currency): Boolean; overload;
 
	function TryStrToCurr(const S: string;
		out Value: Currency;
		const FormatSettings: TFormatSettings): Boolean; overload;


Unit: SysUtils

Type: function

Visibility: public

C++ Information

From SysUtils.hpp

	bool __fastcall TryStrToCurr(System::UnicodeString S, System::Currency & Value);


Unit: SysUtils

Type: function

Description

Converts a string to a Currency value, with a Boolean success code.


Call TryStrToCurr to convert a string that represents a floating-point value to the corresponding 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.

The DecimalSeparator global variable or its TFormatSettings equivalent defines the character that is used as a decimal point. Thousand separators and currency symbols are not allowed in the string. If the string does not contain a valid value, TryStrToCurr returns Default.

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

See Also

Personal tools
Translations
Newest Version