FieldOptionsLegacyNumberFormat Property |
Namespace: Aspose.Words.Fields
When this property is set to true, template symbol "#" worked as in .net: Replaces the pound sign with the corresponding digit if one is present; otherwise, no symbols appears in the result string.
When this property is set to false, template symbol "#" works as MS Word: This format item specifies the requisite numeric places to display in the result. If the result does not include a digit in that place, MS Word displays a space. For example, { = 9 + 6 \# $### } displays $ 15.
The default value is false.
Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Field field = builder.InsertField("= 2 + 3 \\# $##"); Assert.AreEqual("$ 5", field.Result); doc.FieldOptions.LegacyNumberFormat = true; field.Update(); Assert.AreEqual("$5", field.Result);