I tried to convert 11,312,918.2 into a string but I get this 1.13129182E7 as the output which is incorrect. My requirement is add 2 decimal places in to this number 11,312,918.2 where answer should be 11,312,918.20.
I went through other similar topics but no one contained the answer I am looking for. Could somebody help me please?
I do not know whether there exists a node in KNIME that converts doubles to integers or longs whilst preserving the format you want. For me, “11,312,918.20” is just a possible (more human) string representation of “1.13129182E7” among many possible different ones and eventually, if no node deals with this, the following workflow may be a solution:
The -Round Double- node rounds at the right number of decimals and allows the direct conversion of the rounded double to a string in different formats as shown here below, but non of them add comma separators to the string.
Am I missing anything at the node configuration ? Thanks in advance for your feedback.
you are not missing anything. There’s no comma as separator configuration option in this node. I just presented option to get string without exponent easily. Regarding number formatting there have been a lot of topics regarding it and believe there are one node solutions using regex (and probably couple of components) to deal with it. Here I share one:
Thank you for this solution it worked. The data set that I had to work was small data set hence I tried your solution first and it worked. I will try the same solution with a large data set and will let you know the outcome. thanks again.