![]() |
IsMetric |
||||
Header: | OSUtils.h | Carbon status: | Supported | |
Verifies whether the current script system is using the metric system or the English system of measurement.
Boolean IsMetric ();
TRUE if the metric system is being used; FALSE if the English system is being used.
The IsMetric function examines the metricSys field of the numeric-format resource (resource type 'itl0') to determine if the current script is using the metric system. A value of 255 in the metricSys field indicates that the metric system (centimeters, kilometers, milligrams, degrees Celsius, and so on) is being used. A value of 0 in the metricSys field indicates that the English system of measurement (inches, miles, ounces, degrees Fahrenheit, and so on) is used.
If you want to use units of measurement different from that of the current script, you need to override the value of the metricSys field in the current numeric-format resource. You can do this by using your own version of the numeric-format resource instead of the current script systems default international resource.
The IsMetric function is the same as the IUMetric function, which was previously available with the International Utilities Package.
The IsMetric function may move or purge blocks in the heap; calling it may cause problems if youve dereferenced a handle. Do not call this function from within interrupt code, such as in a completion function or a VBL task.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)