CSV file from tag historian showing too many decimal points

I am running an ignition edge project and am storing certain tag values into the tag historian. Once a day I then pull values from the historian and populate them into a csv file. Up until now the number of decimal places has been correct but the last few days it has been populating with way more than I want. I have the individual tag values set to ##0.0. I have included a snippet of the script, a screenshot of one of the tags themselves, and some of the csv file I am seeing.

	#define column names and empty rows
	AIheaders = ["Analog Input","Value","Units","Totalizer","Total Units","Alarm Low Setpoint", "Alarm High Setpoint"]
	AIrows = []
	#iterate through tags, collect values (2-Name,7-Value,12-Units,11-Totalizer,10-Total Units,1-Alm Low Spt,0-Alm High Spt) of each UDT tag
	#show zero when high spt is 1000, low spt is -1000
	for AIudtPath in AIudtPaths:
		AIudt = system.tag.browse(AIudtPath)
		AIrow = [AIudt[2]['value'].value, AIudt[7]['value'].value,
			AIudt[12]['value'].value, AIudt[11]['value'].value,
			AIudt[10]['value'].value, AIudt[1]['value'].value,#create and populate analog input file
		if AIrow[5] == -1000:
			AIrow[5] = 0
		if AIrow[6] == 1000:
			AIrow[6] = 0
	#convert header & rows to dataset then convert to html	
	AIdataset = system.dataset.toDataSet(AIheaders, AIrows)
	AIStatusHTML = system.dataset.dataSetToHTML(True, AIdataset, "ANALOG INPUT STATUS:")
	#write data to dataset												
	AIstatus = '[PLC]AnalogInStatus'
	system.tag.writeBlocking(AIstatus, AIdataset)	


Am I missing something? Do I have to make sure to format the Value columns value in the script and if so how would I do that? I want to have each one of those values set to one decimal point.

That long string of digits is Java attempting to be polite and give you an as-exact-as-possible representation of the value as it can.
If you want to provide explicit formatting, you must do that yourself (by looping over the dataset and changing each float value to a string using your own formatting operation. system.dataset.toHTML doesn't offer you control over this.
You could do this with system.dataset.addColumn and system.dataset.filterColumn (to remove the now duplicate value columns). Or you could install Ignition Extensions and use system.dataset.map.

Or, you could write a script that does what system.dataset.datasetToHTML does, but better; it's not a super complicated bit of scripting.

You may be able to just round it while you're constructing the dataset.


Otherwise, you'd have to format it as a string.


I was thinking it would be nice to use the tag's Format String but it would need conversion into the Python syntax.
e.g. '{AIudt[7]['value'].['Format String'}'.format(AIudt[7]['value'].value)
but that isn't going to work. (I know the syntax is a mish-mash in my example.)