FormatDecimals

View as Markdown

Definition

Rounds the value contained in CurrentValue to a specified number of decimal places before displaying it in the Market Analyzer column.

Property Value

An int representing a number of decimal places to which to round CurrentValue.

Syntax

FormatDecimals

Examples

1protected override void OnStateChange()
2{
3 if (State == State.SetDefaults)
4 {
5 // Round CurrentValue to one decimal place
6 FormatDecimals = 1;
7 }
8}
9
10protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
11{
12 CurrentValue = marketDataUpdate.Price;
13}