Use case
Dynamic texts and captions with a Decimal parameter render with the attribute's default formatting. For example, Content: '{1} / 100', ContentParams: [{1} = HealthScore] shows "20.00 / 100" where the design needs "20 / 100". In Studio Pro, each template parameter has formatting options: decimal precision, group digits, and date format for DateTime. These are stored in the parameter's FormattingInfo, for example DecimalPrecision.
MDL has no way to set them. mxcli syntax --json (v0.24.0) contains no DecimalPrecision, GroupDigits or FormattingInfo. So every number or date shown through a template needs a Studio Pro edit or an extra formatted-string attribute. Re-running the page script then silently brings back the default format.
Proposed syntax (one option)
dynamictext txtScore (Content: '{1} / 100',
ContentParams: [{1} = HealthScore (DecimalPrecision: 0, GroupDigits: false)])
dynamictext txtDue (Content: 'Due {1}',
ContentParams: [{1} = DueDate (DateFormat: Date)]) -- Date | Time | DateTime | Custom 'dd MMM yyyy'
describe page would emit the same, so the round-trip keeps it.
Mendix version
Tested against 11.14.0. The formatting options exist on text-template parameters in 10.x and 11.x.
Use case
Dynamic texts and captions with a Decimal parameter render with the attribute's default formatting. For example,
Content: '{1} / 100', ContentParams: [{1} = HealthScore]shows "20.00 / 100" where the design needs "20 / 100". In Studio Pro, each template parameter has formatting options: decimal precision, group digits, and date format for DateTime. These are stored in the parameter'sFormattingInfo, for exampleDecimalPrecision.MDL has no way to set them.
mxcli syntax --json(v0.24.0) contains noDecimalPrecision,GroupDigitsorFormattingInfo. So every number or date shown through a template needs a Studio Pro edit or an extra formatted-string attribute. Re-running the page script then silently brings back the default format.Proposed syntax (one option)
describe pagewould emit the same, so the round-trip keeps it.Mendix version
Tested against 11.14.0. The formatting options exist on text-template parameters in 10.x and 11.x.