I have a report with two data sources - a static data source and a script data source. There are two columns - a name and a numeric value. They have the same data (within data type constraints).
I have displayed the data in tables. The value column is formatted as#,##0
.
The static data is shown as expected - rounded to 0 decimal places and a thousands separator. The calculated data is not formatted.
Ignition 8.1.28
Screenshots (because I don't see a json export)
static_data
Meter, Value
"Static Meter 1", 32191.110980111298
"Static Meter 2", 8.1
script_data
def updateData(data, sample):
header = ['Meter', 'Total']
rows = []
dataset = system.dataset.toDataSet(header, rows)
data['Computed_Totals'] = dataset
firstValue = 2343.123345234235623434
secondValue = 34534.234325345534534563453
total1 = secondValue - firstValue
newRow = ['Calc Meter 1',total1]
dataset = system.dataset.addRow(dataset, newRow)
total2 = 8.1
newRow = ['Calc Meter 2',total2]
dataset = system.dataset.addRow(dataset, newRow)
data['Computed_Totals']=dataset