adding an extra decimal point on a double column?

Hello I have a little of a problem this line on my Excel, it has the 2 extra decimal points but when it goes to Knime the line get transformed into string (since it has strings in the middle of it) and removes the 0 from it, I then change the column to a Number Double, but it only gives me one 0, how do I add an extra 0 to indicate 2 decimal points?
image
image as an example

Hi @Bleck , it would be better if you shared the source data, which is the data from Excel.

Your screenshot shows the processed version of it, so I can’t tell what was the original data.

In any case, the 2 decimal place is purely for display. Mathematically, 142.0, 142.00, 142.000, 142.0000 are all142, similarly 234.50, 234.500, 234.5000 are all 234.5.

If you are going to do any arithmetic processing, you should keep that column as is. And if it’s a display thing, then it’s ok to have a String type column. I’d still keep both columns, the decimal one and the string one, instead of replacing the decimal column with a string one, in case you need to do any arithmetic processing further down.

I use some manipulation via the Column Expressions to do this:
image

Input data:
image

Results:
image

Here’s the workflow:
adding an extra decimal point.knwf (14.6 KB)

4 Likes

Maybe you like to set the data type of the column directly when reading it into knime instead of using a string and then do additional node processing.

1 Like

Hi @Daniel_Weikert , the data type is correctly set to Double already, but you can’t specify the number of decimal places in Knime tables, at least not that I know of.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.