DataSets can't handle float properly
Posted: Fri Feb 16, 2007 5:21 am
I have been struggling to get my floats (doubles actually) to work correctly.
I think I have found out why, the DataSet can't handle floats correctly.
We have a common framework where an extraction jobs is used to determine which rows are extracted, this is stored in a DataSet then a transformation jobs processes the data. The float is normally converted to a String in the Transformation job, sometimes some calculations are carried out before.
If we do the conversion in the transformation job (DFloatToStringNoExp), the values are not accurate, however if I do them in the extraction job, before they have gone to a DataSet, they are accurate.
I have played around with the length and the scale, but this has made no difference.
Examples of the values, 25548693.134 is the true value, after going through the transformation job (through a DataSet) it looks like 25548700. Also viewing the data in the DataSet it looks like this 2.55487e+07.
Anyone got any suggestions, experience of this? To me this looks like a serious failing, my understanding was that the DataSet was structured like a database table.
I think I have found out why, the DataSet can't handle floats correctly.
We have a common framework where an extraction jobs is used to determine which rows are extracted, this is stored in a DataSet then a transformation jobs processes the data. The float is normally converted to a String in the Transformation job, sometimes some calculations are carried out before.
If we do the conversion in the transformation job (DFloatToStringNoExp), the values are not accurate, however if I do them in the extraction job, before they have gone to a DataSet, they are accurate.
I have played around with the length and the scale, but this has made no difference.
Examples of the values, 25548693.134 is the true value, after going through the transformation job (through a DataSet) it looks like 25548700. Also viewing the data in the DataSet it looks like this 2.55487e+07.
Anyone got any suggestions, experience of this? To me this looks like a serious failing, my understanding was that the DataSet was structured like a database table.