I need help to perform a calculation:

(Pizza Marketing) #1

Hello everyone, I’m new to chatbots and I need to develop something very simple but I’m having difficulties.

A simple javascript operation:
To transform a monetary number of the user input with commas like $ 39.90 at 39.00.

After that, calculate this number with another user input number.
Input 1 = 39.90
Turn into 39.90

Input 1 * Input 2

Do I need to add any input field in this case?

I’m new to FlowXO, I count on the help of friends.

(Pizza Marketing) #2

I already read the help page for this operation, but I did not succeed.

(Daniel Beckett) #3

Hi @Pizza_Marketing

An easier solution could be to use the Text service to replace text. You can look for a character to replace and leave the replacement value empty to remove it from the string.

For example, the following would be looking for the dollar sign ( $ ) and removing it from the answer to a question:

This would leave you with an output that you can do a calculation with through the Number service.

Here’s an example flow which shows how this works:

I hope that helps! :slight_smile:

Thanks,
Dan