Hi Iain,
You can achieve your requirement by using the `CustomFormat`
property, which is used to specify the formatting of the editor's value. Please
refer to the following code snippet for your reference:
Code snippet:
|
this.dataForm.GenerateDataFormItem +=
OnGenerateDataFormItem;
private void OnGenerateDataFormItem(object sender,
GenerateDataFormItemEventArgs e)
{
if (e.DataFormItem != null
&& e.DataFormItem.FieldName == "Amount" &&
e.DataFormItem is DataFormNumericItem numericItem)
{
numericItem.CustomFormat =
"#,0.00##"; // To display a minimum of 2 decimal digits and
a maximum of 4 digits, with grouping.
numericItem.CustomFormat =
"#,#.#"; // To display a maximum of 2 decimal digits, with
grouping.
numericItem.CustomFormat =
"#"; // To display values with no decimal digits.
}
}
|
We hope that this helps you. Please let us know if you
need further assistance.