Convert Double To Percent number

Hello,

How I can change a double number to a percent number ?

Thank You ,

Hi Zoubida, you can use the Math Formula Node and multiply your column with 100. After that, consider the Round Double Node to convert this value to a string. After that, you can add the % symbol by means of the String Manipulation Node.

Hi agaunt ,

thank you so much !

I want also to ask you if i want to represent that data in a historgram with that élement with pourcentage in data report how I can do that because it’s impossible to represent DATA with a string column.

Thank you again !

Have you come across a better way of doing this? I don’t want the column to end up as a string.

Ben

If you are referring to the tables in KNIME you can adjust the format for each column with a right click

2 Likes

isnt that temproary only?

Hello @ben_westphal,

you are somewhat correct as showing number column as percentage is only representation of underlying value. What’s your use case/idea/requirement/wish regarding percentages in KNIME? I would simply work with doubles in range [0,1] and if needed for presentation/output purposes use Math Formula to multiply it with 100 followed by String Manipulation node to add % char.

Br,
Ivan

Essentually I think it adds clarity to be able to add chracters. Think columns with15 different currencies. I want the right number type and the chars in for from clarity. An outcome in one misten currency can make a big problem down the traxk. Same logic with percentage. Unless I am missing something here… ive been a heavily excel modeller hiatorically and have some ttansferable (in my view) best practices I am trying to implement in our team. Thoughts?

What I mean is that I would like to set a number format more bespoke to my needs rather than simply add at the end like this. It may be possible and this is just showing my ignorance! Ben

Hi @ben_westphal,
putting the percenrage sign behind the number is only possible then you convert the value to a string. But then you lost the possibility for further math calculationns.
The only apps i can remeber which can format values and do further calculations on the values are table calculation apps like “Microsoft Excel”.

But why not put the (%) sign into the columnname and let the value nummeric. This is also a common way to show the and not only for calculations but also within scientific presentations.

BR

1 Like

Understood. This is generally fine as you suggest. My point is that the feature we are discussing adds more clarity (I dont think thats unreasonable to say). And that there are circumstances where additional clarity would be useful. Especially when dealing with a large number of different units or currencies. If not possible or not on the roadmap we will continue approaching in the same way you do.

Thanks for your thoughts.

Ben

2 Likes