I am subtracting $3,456.65 with $3,231.78. I’m using the Numeral.js in that case, but the bot doesn’t compile it. How to fix this situation and carry out this operation?
Thanks
I am subtracting $3,456.65 with $3,231.78. I’m using the Numeral.js in that case, but the bot doesn’t compile it. How to fix this situation and carry out this operation?
Thanks
It is not possible to use the Numeral library within the “Assign value to variable” activity.
What you want to do (take amounts from strings that have the “$” symbol and then calculate the difference between them) can be peformed by first using the “replace” method to remove the “$” symbol, and then using the “Number” method to turn the string into a number variable.
Just like this:
After you run it, the variables will look like this:
Notice that old_value and new_value don’t have the quotes (") around it, nor the “$” symbol.
Let me know if this works for you!
Thank you, it has helped me a lot. Sorry for the delay in responding.