IVZBaseFormatter.NumberFormatter

Syntax

NumberFormatter: IVZNumberFormatter;

Description

The NumberFormatter property determines a format of visualizer numeric data.

Example

Executing the example requires that the repository contains an express report with the EXPRESS identifier that contains a bubble tree.

Add links to the Express, Metabase, Visualizators system assemblies.

Sub UserProc;
Var
    Metabase: IMetabase;
    Analyzer: IEaxAnalyzer;
    BubbleTree: IVZBubbleTree;
    Formatter: IVZBaseFormatter;
    Format, OutStr: String;
    Params: IVZDataArray;
    Value: Double;
    FormatNum: IVZNumberFormatter;
Begin
    // Get repository
    Metabase := MetabaseClass.Active;
    // Get express report
    Analyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    // Get bubble tree
    BubbleTree := Analyzer.BubbleTree.BubbleTree;
    { Get region name by its identifier and
    value by color scale }

    Formatter := BubbleTree.Formatter;
    Format := Formatter.FormatById("Region: {%Name}, " +
    "element value by color scale: {%ColorValue}""17""no data");
    Debug.WriteLine(Format);
    // Get percentage expression of the 0.42535 number
    Value := 0.42535;
    FormatNum := Formatter.NumberFormatter;
    FormatNum.ConvertInvariant2LocalNumberFormat("0.00%");
    FormatNum.LocalFormatObject(Value, "0.00%", OutStr);
    Debug.WriteLine("The 0.42535 number expressed as percentage: " + OutStr);
    { Get exponential format of record of number 2011 and
    record of the 15258.2 number with two decimal places }

    Format := Formatter.FormatByParams("Exponential format of record of number 2011: " +
    "{0:0E+0}, record with two decimal places: {1}"201115258.2"0.00");
    Debug.WriteLine(Format);
    // Obtain records of two phone numbers in a user-friendly format
    Params := New VZDataArray.Create;
    Params.Add(89209242536);
    Params.Add(84922444090);
    Format := Formatter.Format("Contact phones: {0}; {1:#(####)##-##-##}", Params, "#-###-###-##-##");
    Debug.WriteLine(Format);
End Sub UserProc;

After executing the example, the development environment console displays:

See also:

IVZBaseFormatter