Table cell displays NaN for small number (Bug ?)

I have linked a dataset to a table in perspective. The table does not show scientific notation. When I enter values is removes the scientific notation.

Example:

The value in the dataset is 6.9592e-8. The table displays NaN. (see below).

When I double click on the field to edit the value I can see the correct value:

However, when I enter the value 7.8888e-8 and press enter the value is converted to 7.89 (no scientific notation)

result after pressing enter:

The column formatting is set as follows.

I changed the number format from 0,0.## to "0.00e+0"
The displayed value is correct (no longer NaN) but when I enter a new value , it displays e+0 rather than e-8. Plus, I don't want my values all displayed in scientific notation, just the very big and very small numbers.

Is this a bug or am I doing something wrong ?

Check that you're not passing scientific notation as a string.

That's great.. Can you show where you put the code and examples of the code ?

I've never actually run into the problem. I happened to see the other post in the last couple of days and remembered it.

You have two choices. If the dataset is coming from a database query you could sort it out at the SQL level. If not (or if the dataset is coming from something else) you could run a script transform on the dataset.

Please explain your configuration and what you want to happen with small numbers. e.g., Do you want to round anything below 0.0005 to zero?

The dataset column I am writing to is the type float.

Here is the original code in "onEditCellCommit"

def runAction(self, event):
	valueToSet = event.value
	system.perspective.print(valueToSet)
	newData = system.dataset.setValue(self.props.data, event.row, event.column, event.value)
	system.tag.writeBlocking('[s1500]UnitConversion/UnitConversionTable', newData)
	system.perspective.print("new value entered:{} Row:{} Col:{} ".format(valueToSet, event.row,event.column))
	
	

console ouput:
image

When I tried converting event.value to float it still produces the same problem:

def runAction(self, event):
	valueToSet = float(event.value)
	system.perspective.print(valueToSet)
	newData = system.dataset.setValue(self.props.data, event.row, event.column, event.value)
	system.tag.writeBlocking('[s1500]UnitConversion/UnitConversionTable', newData)
	system.perspective.print("new value entered:{} Row:{} Col:{} ".format(valueToSet, event.row,event.column))
	

browser console output:
image

Table display after entering value of 7.8888e-8: (incorrect)

note that the table is bound to the memory dataset tag "[s1500]UnitConversion/UnitConversionTable", bidirectional is unchecked

Again, I may not be your best hope of success. It's still not clear to me whether 6.9592e-8 is the actual value you want to store or if it's a rounding error that you want to get rid of. If it's the latter can you use a Python / Jython floor() function?

Yes, I want to store very small numbers like 7.8888e-8. ( and very large ones too ) I know there are rounding errors when you get into the weeds with floating point storage but I am not worried about those errors I just want to understand why the exponent is removed when I enter values into the data table.

A bug is part of your issue:

And in your example code you have the line:

system.tag.writeBlocking('[s1500]UnitConversion/UnitConversionTable', newData)

The parameters to writeBlocking need to be lists:

system.tag.writeBlocking(['[s1500]UnitConversion/UnitConversionTable'], [newData])

Thanks for input ! I will fix my code and wait for bug fix.