flatfileinterface: unable to read float value

0
Hi, I am using flatfileinterface to read a csv file ,pipe separated. eg: FCA|2015|31-12-2015|9187|B12345|ABC|-55932887.49|-22520206.07|USD but its failing to read the number -22520206.07 (Data type i tried both float and currency) i/p: -22520206.07 o/p: -22520206 could anyone please suggest me how to handle this?
asked
1 answers
1

You're trying to get the fields in columns 7 and 8 into a float attribute by means of the flatfile importer. When doing so you're loosing precision on the numbers. The cause of this is the conversion in the flatfile importer module. The numbers are converted to float wioth a parsefloat method. On larger numbers this can cause issues with the precision. Therefore your number -55932887.49 will be converted to -55932888. The solution could be to convert to a double in stead of a float in the code of the flat file importer module. A workaround can be to switch from importing the numbers into floats directly, to importing the value into a string field and perform the conversion to float in Mendix.

I will investigate if the code can be changed so that the precision issue can be circumvented in a new release, but in the meantime please use the work around to get your data into your application (this I tested and will work)

answered