Dynamic number formating based on data value
Posted: Mon Dec 21, 2020 5:36 pm
Let's have a datasource MyData with values
ID| Value | Resolution
1 | 123.456 | 3
2 | 123.456 | 0
3 | 123.456 | 2
I want to display Value with decimal places defined in Resolution. So in consecutive detail sections each Value should be formated differently. Like this:
123,456
123
123,46
Now to achieve this I use the expression:
Is there an easier way to format text fields bases on value from current record in datasource?
Something like N{MyData.Resolution} ?
Thank you.
ID| Value | Resolution
1 | 123.456 | 3
2 | 123.456 | 0
3 | 123.456 | 2
I want to display Value with decimal places defined in Resolution. So in consecutive detail sections each Value should be formated differently. Like this:
123,456
123
123,46
Now to achieve this I use the expression:
Code: Select all
{Replace(Format("{0:N"+MyData.Resolution+"}", MyData.Value), " ", ",")}
Something like N{MyData.Resolution} ?
Thank you.