| Package | com.esri.bacore |
| Class | public class ValueFormatter |
| Inheritance | ValueFormatter mx.formatters.NumberFormatter |
| Implements | IValueFormatter |
| Property | Defined By | ||
|---|---|---|---|
| formatUnits : Function
A function providing units for a formatted value. | ValueFormatter | ||
| Method | Defined By | ||
|---|---|---|---|
Initializes a new instance of the ValueFormatter class. | ValueFormatter | ||
formatValue(value:Number, decimals:int):String
Converts a numeric value to a string representation with the required number of digits after the decimal point. | ValueFormatter | ||
formatValueWithUnits(value:Number, decimals:int, valueType:BAValueType):String
Converts a numeric value to a string representation with the required number of digits after the decimal point
provided with units if necessary. | ValueFormatter | ||
| formatUnits | property |
formatUnits:FunctionA function providing units for a formatted value.
The signature of this function is the following:
FormatUnits(formattedValue:String, valueType:BAValueType):String;
It can add units to a formatted value and return the resulting string. For example, if the
valueType is BAValueType.PERCENTAGE, this function can append the percent sign
to the input formattedValue. If units are missing for the given value type, the function should
return the input formattedValue.
If this function is null, units are not added to a value formatted with the
FormatValueWithUnits method.
public function get formatUnits():Function public function set formatUnits(value:Function):void| ValueFormatter | () | Constructor |
public function ValueFormatter()Initializes a new instance of the ValueFormatter class.
| formatValue | () | method |
public function formatValue(value:Number, decimals:int):StringConverts a numeric value to a string representation with the required number of digits after the decimal point.
The base version formats a value using the format method of the base class
with specified decimals as a precision value.
Parameters
value:Number — A numeric value to be converted.
| |
decimals:int — The number of significant digits after the decimal point.
Negative value means unknown number of digits.
|
String |
| formatValueWithUnits | () | method |
public function formatValueWithUnits(value:Number, decimals:int, valueType:BAValueType):StringConverts a numeric value to a string representation with the required number of digits after the decimal point provided with units if necessary.
The base version formats the value using the FormatValue method and after that adds units
if necessary using the FormatUnits function associated with this formatter.
Parameters
value:Number — A numeric value to be converted.
| |
decimals:int — The number of significant digits after the decimal point.
Negative value means unknown number of digits.
| |
valueType:BAValueType — Type of value.
|
String |