const EnUS TFormatSettings

By Serdar S. Kacar

Freeware 05 Oct 2010

In category

Components > Tools > Multi Language

Description

Programs that store variables as strings by various formating functions have a serious risk of unexpected behaviour in the following cases :

  • Variables written in a locale and read from another one,
  • Even if the locales are the same, a user has "customized" her own locale settings.
Something as simple as storing a double in an INI file could be bothersome.

The solution is already, but partially, provided by Delphi as various formating functions support an optional a parameter of type TFormatSettings.

A constant of type TFormatSettings that "never" changes is the only thing we need to satisfy the locale-safe requirements.

This unit includes English (United States) format settings as

. const FormatSettingsEnUS: TFormatSettings = (...)

This unit also includes conversion routines for TDateTime and ctime() formatted strings.

Keywords: Localization, Format, FormatFloat, DecimalSeparator, ctime()

Informations

  • Status: Fully functional
  • Source: FW
  • Size: 4 479kB

Platforms:

  • Delphi 7

Downloads