Showing small numbers as string

Hello Community,

I have the following problem: I want a small number to represented as a string. An example is 0.00046. I want it to be shown as 0.00046, but when I use the number to string node it outputs 4.6E-4. I have not found a satisfying solution to this problem. Does anyone have an idea how to tackle this without changing the number manually?

Thanks a lot!

Thanks for bringing this up - I wanted to open a similar topic, but for the same issue occurring with large numbers.

In my case I solved it by converting to long, subtracting long from original value and then converting both to string and then combining them in column expression, but this is not satisfying… none of the native nodes available seem to solve this - number to string, column expression conversion…

I strongly suggest that a feature to reliably convert any number to string in non-scientific notation is added or enhancements made to existing nodes.

==> Moving to feedback and ideas

3 Likes

I agree that KNIME number rendering can be frustrating at times. “Full precision” appears to be “scientific notation” and certainly not what I would call “FULL precision”!

The “Standard Double” render is even worse.

Screenshots above are from Classic UI. Modern UI looks slightly different but the renderers have exactly the same limitations.

If you are ok with converting the number to a string, but want to retain full precision, then the dubiously named “Number Rounder” node should be able to handle it. (In older versions of KNIME this was called the “Round Double” node. And in neither case does the name indicate some of its potential :wink: )

Tell it to “round” using significant digits, and then give a very high number of digits (e.g 30) which is larger than full precision doubles can return, so it doesn’t actually do any rounding :slight_smile:

Now, the all important (and really useful) part is hidden away in “advanced settings” at the bottom.

If you click that, you get the “legacy” option to return the value as a standard string. No idea why its “legacy” - I don’t know of any “non-legacy” replacement for this functionality… but anyway your impossible-to-read Double becomes a string like so:

image

2 Likes

Thank you very much, I’ve tried the number rounder, but overlooked the advanced settings. The standard string output mode did the trick! :slightly_smiling_face:

I’m still with MartinDDDD that there should be an addition to the number to string node to show full numbers as string

2 Likes

I agree. This “legacy” option has been hidden away almost certainly because when the Round Double node became the Number Rounder node, the option was retained simply for backward compatibility, and I’d imagine the intention is that it is functionality that will be moved somewhere else.

There should be more obvious node dedicated to this conversion.

I also strongly feel that a “full precision” renderer on the output table should allow us to see the number in … erm…what’s the term?.. ah yes “full precision” :wink: (i.e. all the digits represented in all their glory!).

Hi,

takbb, thanks for showing that option. I also added a +1 for you to a ticket (internal reference AP-20609).
If the use case is not writing to a string, but showing the number in a table of an app/report, you can use the Number Format Manager – KNIME Community Hub.
Our plan is to make those more flexible formatting options also available to the Number to String node.

Thank you for the feedback,
nan

2 Likes