I’m trying to put a decimal(10,5) from a MySQL database to a Float4 or Float8 tag and as soon as my value is below 0.0001 (eg: 0.00002), the write can’t complete.
While trying stuff around, I also found a strange behavior (Ignition 7.9.5 just in case) :
Create a Float4 or Float8 tag
Create a Numeric Textfield bounded bi-directionnaly to the tag
Enter 2e-3 >> OK
Enter 2e-5 >> OK
Enter 2e-7 >> Forfeit
Enter 2e-3 >> OK
Enter 2e-7 >> OK
Enter 2e-5 >> Forfeit
One time, the 2e-5 is ok but not the other time. Same goes for 2e-7. Strange.
I know computers have issue with numbers not being ^2 based and I guess this is related to that. Sadly it seems Ignition does not offer a numeric type equivalent to MySQL decimal(x,y) type.
The only workaround I found so far (apart multiplying all my values from MySQL) is writing my value to a String tag and then casting it to a Double tag. Even though it works, I don’t find it “clean”.
If anyone has another idea, I’d be delighted to hear about it.
Thanks