Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CurrFormatFromLCID(const AValue: Currency; const LCID: Integer = LOCALE_SYSTEM_DEFAULT): string;
- var
- AFormatSettings: TFormatSettings;
- begin
- GetLocaleFormatSettings(LCID, AFormatSettings);
- Result := CurrToStrF(AValue, ffCurrency, AFormatSettings.CurrencyDecimals, AFormatSettings);
- end;
- function USCurrFormat(const AValue: Currency): string;
- begin
- Result := CurrFormatFromLCID(AValue, 1033); //1033 = US_LCID
- end;
- function FrenchCurrFormat(const AValue: Currency): string;
- begin
- Result := CurrFormatFromLCID(AValue, 1036); //1036 = French_LCID
- end;
- procedure TestIt;
- var
- val: Currency;
- begin
- val:=1234.56;
- ShowMessage('US: ' + USCurrFormat(val));
- ShowMessage('FR: ' + FrenchCurrFormat(val));
- ShowMessage('GB: ' + CurrFormatFromLCID(val, 2057)); // 2057 = GB_LCID
- ShowMessage('def: ' + CurrFormatFromLCID(val));
- end;
Add Comment
Please, Sign In to add comment