System.ConvUtils.ConvUnitToStr

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function ConvUnitToStr(const AValue: Double; const AType: TConvType): string;

C++

extern DELPHI_PACKAGE System::UnicodeString __fastcall ConvUnitToStr(const double AValue, const TConvType AType);

Properties

Type Visibility Source Unit Parent
function public
System.ConvUtils.pas
System.ConvUtils.hpp
System.ConvUtils System.ConvUtils

Description

Formats a measurement and its conversion unit into a human-readable string.

Call ConvUnitToStr to obtain a string representation of a measurement.

AValue is the number of units.

AType is the conversion type (unit of measurement).

ConvUnitToString formats the result as the string representation of AValue followed by the description that was provided when AType was registered. Thus, for example,

ConvUnitToStr(3.5, duMiles)

returns the string "3.5 Miles"

Warning: The resulting string may seem awkward, depending on the description provided when registering the conversion type. For example, ConvUnitToStr(53, duFahrenheit) produces the string "53 Fahrenheit", not "53 degrees Fahrenheit".

See Also