Report Table Cell Number Format Dynamic

Hello,

I have a customer that would like the number format of several cells of a row of data to be #,##0.0 if the cell value is >= 1 and #,##0.00 if it is < 1. Is this possible?

‘’

I am afraid you can do that for each cell.

I am talking about a table component in a report not a power table component in a vision window.

Right click the number format property of the cell you want to change and select ‘use dynamic data key’. You can use a simple ternary-style if statement to choose between your two desired number formats:
https://docs.inductiveautomation.com/display/DOC80/Keychain+Expressions#KeychainExpressions-ConditionalKeychainExample

One thing that is not in the IA docs is formatting within the keychain.
@Value.format("#,##0.0")@

3 Likes

I used:

data<1?"#,##0.00":"#,##0.0"

Worked great, thanks guys!

Well, I was thinking along the lines of

@Value < 1 ? Value.format("#,##0.00") : Value.format("#,##0.0")@

But I like yours too. If it works, it works! :+1:

1 Like