Carl wrote:
In XE8, I get the errors,
E2003 Undeclared identifier: 'CurrencyFormat'
E2003 Undeclared identifier: 'CurrencyString'
What do I need to do differently?
The global formatting variables were deprecated in XE and removed in XE3:
http://docwiki.embarcadero.com/RADStudio/XE3/en/Global_Variables
Twenty global variables that previously resided in System.SysUtils, and which
have been deprecated for several years, have now been removed from the product.
These global variables typically pertain to date, time, and currency format
(CurrencyString, LongTimeFormat, ShortMonthNames, and so on).
You need to use the TFormatSettings record now, which was introduced way
back in Delphi 7:
var
Fmt: TFormatSettings;
{$IF RTLVersion >= 23} // XE2+
Fmt := TFormatSettings.Create;
{$ELSE}
GetLocaleFormatSettings(0, Fmt);
{$ENDIF}
Case Fmt.CurrencyFormat of
0: Result := Fmt.CurrencyString + InNumber;
1: Result := InNumber + Fmt.CurrencyString;
2: Result := Fmt.CurrencyString + ' ' + InNumber;
3: Result := InNumber + ' ' + Fmt.CurrencyString;
else Result := Fmt.CurrencyString + ': ' + InNumber;
end;
--
Remy Lebeau (TeamB)
Connect with Us