Hi,
I have a problem with the rounding of floating point numbers.
I read numbers from a file, such as 0.0000295710, 24861.19, and 116342.61, which transformer converts into a numeric type. I simply map field from varchar to float/double, without using any function.
The problem is that if I use float or double type values are rounded. If I use the decimal type, appear before the number so many zeros as they serve to fill the field.
What is the proper way to convert a field to numeric type without losing precision?
These values will be loaded into a sqlserver DB.
Thanks in advance
convert to number type without losing precision
Moderators: chulett, rschirm, roy
Hi,
I experimented that data mapped within transfomer from varchar to double seem to be truncated viewing that from ds viewer, but in sqlserver tables they are correctly conformed to input.
By my experience, float sqlserver must be mapped to double (dfloat) datastage type.
Otherwise if you map to float ds you obtain data not correctly rounded.
Good luck
I experimented that data mapped within transfomer from varchar to double seem to be truncated viewing that from ds viewer, but in sqlserver tables they are correctly conformed to input.
By my experience, float sqlserver must be mapped to double (dfloat) datastage type.
Otherwise if you map to float ds you obtain data not correctly rounded.
Good luck