Float/Decimal values from query are rounded to 0.001

Hey all,

I am trying to pull float and or decimal datatypes via a named query, but Ignition rounds to 0.001, when the values I need are 1.0E-10. Originally I used the float type in the DB, then changed to decimal(12,11). (SQL Server)

Aside from multiplying the incoming decimal value by 1.0E+10, is there something else I can do?

Thanks.

Are you sure the value you're trying to pull has an exact float/double representation?

SQL databases support, or at least claim to, arbitrary precision decimals, but those ultimately get mapped down to Java primitive data types, which are (for floating point) either 32 bit or 64 bit IEEE-754 floating point.

Yeah, don't use decimal. Ignition doesn't have a matching data type (would be java's BigDecimal).

Well, I started off by using the default for float, which is float(53). Then changed it to float(24), ISO synonym for real. Then changed it to decimal(12,11).

Data with decimal:

Float(53):

Query results:
image

Not sure where you are looking at the query results, but try changing the number format on that component. Either to none or scientific in Perspective. Maybe something like 0,0.#############