Skip to main content

I have a script that uses excel reader and writes into a SQL database. It works fine but one issue is that a field I'm trying to copy has a 'version number' such as 5.1.01 or 5.3 where 5.1.01 is coming out fine but 5.3 is appearing in the db as 5.29999999 as shown below

result

The version column is set to 'Text' in the excel sheet.

The excel reader is using the 'char' type as shown belowreader_attribute

The writer is set to use the 'nvarchar' type as shown below, which is the same as the type in the database 'nvarchar(255)'

writer_attribute

It appears somewhere in the process these values are being interpreted as a decimal or float but I haven't been able to work out how to fix this.

I'm relatively new to FME so Its possible I may be missing something.

 

Any help would be greatly appreciated.

 

Have you double checked that the figure is definitely 5.3 in the excel sheet?

This cell is formatted as text and displays 5.3 but if you look at the formula bar it's actually the decimal

 

Capture


Hi Ebygomm, thanks for the response.

I've just checked and that isn't the case.


Hi Ebygomm, thanks for the response.

I've just checked and that isn't the case.

Is your workspace doing anything other than transferring data from excel to sql?


Reply