RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
ConvUtils.ConvUnitToStr Function

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

Pascal
function ConvUnitToStr(const AValue: Double; const AType: TConvType): string;
C++
AnsiString ConvUnitToStr(const Double AValue, const TConvType AType);

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".
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!