You are viewing limited content. For full access, please sign in.

Question

Question

Token Calculator/ token value with a dot instead of a comma

asked on September 13, 2023

Hi everyone,

I am trying to figure out how can i get the token calculator activity works when i have (for exemple) a token value new_price = 20.25. 

Total_amount=(%(new_price)-%(previous_price))*(%(quantity))

The Activity works well when the value is 20,25 but i get an error with the value including the dot separator.

I can't use the comma separator because i am passing the results to a csv file, so the comma will separate the single value in two columns at each ",".

Could you help to fix this please, any ideas?

 

Thank you in advance!

 

 

0 0

Replies

replied on September 13, 2023

Workflow will use the OS language (and regional number and date settings) from its service user. So if your OS dictates that the decimal separator is a comma, then that's how numbers are rendered. "20,25" is a number, while "20.25" becomes just a string.

You could replace commas with periods using the Substitute function in Token Calculator. Alternatively, if you enclose all your values in double-quotes, the CSV file will not automatically make new columns when it finds a comma as a decimal separator in a number.

0 0
replied on September 25, 2023

Thank you for your reply!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.