I had quite some trouble to display numbers in the webportal in readable fashion with a thousand-seperator " , " within the “Table Editor” node.
Generically, it seems that number formats don’t come with seperators (except decimal seperators, which you can easily check in the node configuration itself. Would be cool to have this feature for thousand seperators as well.) (see example screenshot 1). The number to string does not work, as a decimal seperator is set straight after the first number. Furthermore, the number formats are shown with exponential convention.(see example screenshot 2) I also tried the round double node as workaround, which also did not solve the thousand seperators issue.
Screenshots:
Normal number Format in Table Editor View:
Format after number to string in Table Editor View:
The only thing left was to scale numbers down to avoid thousand seperators in the first place.
Is there any solution to this? Can CSS help out here? I found the class “.knime-double” which looked promising, but my CSS know how is limited.
Or maybe I am missing something straightforward here?
Looking forward to ideas and solutions.
This helps absolutely for the time being! Thanks alot!
Though I was hoping for a more “low code friendly” solution, as it is quite difficult to explain to colleagues that we want to use low code tools, and then the solution is JS / R / Python etc. based. Even though this means of course just copying the col. expressions node into the workflow for this instance.
Would it be a solution to include this option into the table view nodes as well, since there are already formatter tabs available? Or does it make sense to make this feature available in the number to string formatter node? The other way around, this option is included (in the string to number node, obviously to identify the number correctly)? This would be very helpful when formatting numbers in emails, reporting etc. as well.
Anyways, thanks alot for the solution We can definitely work with it!
Hi @wkhan , it could still be that the data needs to be kept as string lol. I just did not see the restriction, so hopefully the data does not need to be kept as string
This is exactly the reason why I have to format numbers to a string: The web portal does not portray doubles in a readable fashion with thousand separators, in contrast to the generic knime data preview function!
This also applies for email reporting: knime preview looks fine for doubles. But the eventual email contains number format like e g. 1224005326,2. Pretty hard to read…
Pretty simple and understandable although involves some coding. See here for more:
Agree it would be nice for Number to String to feature separator configuration actually (will create ticket; Internal reference: AP-16673). And probably same goes for JavaScript View/Editor nodes…