Try OpenEdge Now
skip to main content
Internationalizing Applications
Preparing the Code : Data-processing issues : Measurements


Measurements are a type of numeric data with several cultural components that your application must handle. An international application must not hard code any manipulations of measurement data. When working with measurements there are two aspects to consider: nonmetric units of measurement and industrial standards.
The international system for spatial measurement is the metric system. The most common system for measuring temperature is the Celsius system. If one of the locales where your application runs uses a different measurement system, the application should convert data so that your users can work with the measurement system they expect.
In most business or industrial applications, a simple conversion of kilograms to ounces does not allow users to work with the measurements they know best. A simple conversion often results in measurements that are awkward or that do not reflect local standards. For example, a standard size for photographs is 10x15 centimeters. In the United States, the equivalent standard is 5x7 inches. Converting from metric or from inches gives you accurate equivalencies, but not useful ones. The application designer must analyze the measurement systems and standards used by the target business sector in the various locales. In some cases, your code might use a straightforward conversion. In other cases, your code must work with equivalencies.
You should create an internal standard for handling measured data to avoid inconsistencies. A suggested technique is to print, display, and input measured data in the format needed by users and convert it to the appropriate internal standard data format for storage. If you use the same standard representation throughout your application, you have to write only two conversion routines for each format: one to convert from input format to the internal standard and one to convert the internal standard to its display format. You can perform all internal calculations referencing one format and avoid making changes throughout your application during localization. You also can use the same data for all locales; all you have to do is update a conversion routine to reflect a new display format.