Number with $

Good afternoon guys,

I’m working in a new project, I trying to add the $ symbol to a column with numbers, but I don’t want to transform a column into String and just added. I download “Cell Formatter” but I don’t know how can use it.

(The file is a CSV. file, so I try to write it like that:

Screen Shot 2020-04-28 at 17.05.20

Somebody can help me?

Thanks in advance

Hi and welcome - There is no double data type column renderer for currency, and there is no currency data type; if you want your CSV file to have currency columns, you’ll need convert the column to String first and then prefix a “$”. Is there a reason you don’t want to transform it to String?

Hello quaeler,

Thanks for your reply, yes, I have a reason. I don’t know why, but when I transform this data with “Number to String”, the columns add a “.0” in all the rows, so I need to do a “String Manipulation” and more to remove that and I don’t want to manipulate very much the numbers.

Also, I need to change the color in this column, and according to the “Continental Nodes”, this is the way to manipulate all these things

Thanks in advance

Hmm… well since you’d be doing string manipulation to prepend the currency symbol, you could adjust the trailing decimal to at the same time.

Concerning the coloring, i think i’ve misunderstood you; i thought you were writing to CSV, but apparently you’re writing to XLS/XLSX. In that cases, perhaps there is a Continental Node which lets you denote that column as a currency column when writing the Excel file?

1 Like

Hi there @IvaR,

This happens because your number column is type Double. Use Double To Int node or check prior in your workflow where column (that seems should be Int) became Double. Maybe in Math Formula node? There you have check box Convert to Int.

Regarding Continental nodes and $ sign. Not sure they can define column type but maybe I’m wrong! Have you checked example workflows provided by Continental:

Br,
Ivan

1 Like

I apologize for the misunderstood, maybe I don’t explain myself in the best way.

I don’t know if I can use this nodes for my purpose, but I want to know if I can do it with the less data manipulation possible.

Thanks for your answer

Are you writing to a CSV file or an XLS/XLSX file?

I made the suggested changes, that page is amazing, it gives me a lot of information.
Thank you!!! I really appreciate it! : relaxed:

1 Like

Is an CVS. but I need the result be an XLS doc

Screen Shot 2020-04-29 at 15.00.00

How can I deleted the “.0” in the same string manipulation?

Ok - you are reading a CSV and outputting an XLS doc. In that case, is there maybe a Continental Node which allows you to format a column as a currency data type? If you can do that, that should address your problem.

hahaha, yes, this is exactly the issue :slight_smile:

Try using something like $###,###.## (adding more or removing placeholders as is relevant to your data) in the text format option of the cell formatter node, in that case.

1 Like

Doesn’t work D: and now I remember why I need a number format, because I need the separators, when I just add the “$” can’t see it like that:

Screen Shot 2020-04-29 at 16.24.46

In the last picture I colored the cells in pale yellow, with XLS Background Colorizer, but I can’t define just the used area…maybe you have a solution for that :wink:

I can’t seem to install the Continental Nodes (i end up with one single node - a network something - in the folder in my node repository) so i can’t test out what you’re doing. The wording under Data Type & Format appears to be saying that it is using the text format not to format the output, but as conversion from a string to a numeric value. If that’s the case, the text formatting is not what you want to be doing.

I guess that leaves you with having the user opening the XLS sheet having to change the format of that column to currency - unless someone else knows an XLS formatting node that will do this.

2 Likes

Well, thank you very much for your time :slight_smile: and for all the useful advices

2 Likes

@arbe can you help on this one?
Ivan

1 Like

Try to add https://nodepit.com/node/com.continental.knime.xlsformatter.portmerger.XlsPortMergerNodeFactory
to apply all formatting. I use $#,#0 format and it works

3 Likes

OMG! finally works, thanks @ipazin and @izaychik63, lot of thanks!!! :100:

1 Like

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