Format()

View as Markdown

Definition

This method allows you to customize the rendering of the performance value on the Summary grid.

Syntax

public override string Format(object value, Cbi.PerformanceUnit unit, string propertyName)

Examples

1public override string Format(object value, Cbi.PerformanceUnit unit, string propertyName)
2{
3 double[] tmp = value as double[];
4 if (tmp != null && tmp.Length == 5)
5 switch (unit)
6 {
7 case Cbi.PerformanceUnit.Currency : return Core.Globals.FormatCurrency(tmp[0], denomination);
8 case Cbi.PerformanceUnit.Percent : return tmp[1].ToString("P");
9 case Cbi.PerformanceUnit.Pips : return Math.Round(tmp[2]).ToString(Core.Globals.GeneralOptions.CurrentCulture);
10 case Cbi.PerformanceUnit.Points : return Math.Round(tmp[3]).ToString(Core.Globals.GeneralOptions.CurrentCulture);
11 case Cbi.PerformanceUnit.Ticks : return Math.Round(tmp[4]).ToString(Core.Globals.GeneralOptions.CurrentCulture);
12 }
13 return value.ToString();
14}