I've tried a bunch of things with ToCurrency and MakeCurrency but cannot get this to work.
What I've got is collecting a payment amount from a caller that they enter, including the cents, ie $125.50 would be entered as 12550. I need to then create a string that's decimalised that so 125.50. But I also want to play that out to the caller as $125.50 specifically. No matter what I do I cannot get that currency piece to work.
Can someone please help me out here as it seems like it should be obvious but I've obviously missed something.
Hi Jason the issue seems to be specifically around how I use quotes. One of the currency functions looks to require quotes passed in, but I need to include a variable in there. If I put the variable between quote marks then the variable name, not the contents will be passed through and it fails.
So there are three steps you want to accomplish here. The first step is putting the decimal place into your string. The second step is converting that string to a Decimal. The third step is converting that string to a currency.
For the first step (putting in the period into the string), you could do this:
You could use this expression inside of an Update Data action. For accomplishing the second step, you could create a Decimal variable and use this expression as the value to assign, and the string value created by that expression will be automatically converted to a Decimal.
For the third step (converting to a currency):
MakeCurrency(Flow.userInput, "USD")
You can put that into a new currency variable using an Update Data action, or just put it directly into a Play Audio action's Expression sequence item.
If you wanted to do this all in one step, you could use this:
You can put that into a new Currency variable using an Update Data action, or just put it directly into a Play Audio action's Expression sequence item.