5

I want to receive a dollar amount in my utterance. So, for example, if I ask Alexa:

Send $100.51 to Kroger.

(pronounced, One hundred dollars and fifty one cents) I want to receive the value 100.51 in a proper slot.

I have tried searching and I defined my utterance slots like this:

"slots": [
    {
        "name": "Amount",
        "type": "AMAZON.NUMBER"
    } 
]

But on JSON input I only get this result:

"slots": {
    "Amount": {
        "name": "Amount",
        "value": "?"
    }
}

How can I make Alexa accepts currency values?

Ninita
  • 1,209
  • 2
  • 19
  • 45
ewassef
  • 286
  • 2
  • 13

2 Answers2

6

I'm a bit confused by what you wrote in your last sentence and the code, but I'll confirm that there is no built-in intent or slot for handling currency.

So, you'll have to do it manually using AMAZON.NUMBER slot type as you seem to be trying.

I would imagine that you will want to create utterences with two AMAZON.NUMBER slots - one for dollars and one for cents.

Tom
  • 17,103
  • 8
  • 67
  • 75
  • If i understand what you're saying, do you mean create an utterance: Send {DollarAmount} dollars and {CentsAmount} cents? – ewassef Feb 16 '17 at 15:29
  • @ewassef yes, that is what I mean. – Tom Feb 16 '17 at 16:57
  • Here is an [issue](https://alexa.uservoice.com/forums/906892-alexa-skills-developer-voice-and-vote/suggestions/32402266-money-type) for the lack of a money/currency slot type. We can vote it up to hopefully make it a higher priority. – Danny Guo Apr 30 '18 at 03:06
1

Easy, make a custom slot and just use $10.11, $.03, and $1003.84 as the sample's. It will work as currency now, accepting users dollars and cents utterances and converting them to a dollar $XX.XX format.

BiTZOiD
  • 59
  • 1
  • 8
  • Not sure that is right. I tried and does not work. Created custom slot for dollar custom slot and added sample values like $10.11, $.03, and $1003.84. When evaluated with "1 dollar 20 cents", alexa returns "1 dollar 20 cents" for slot value instead of "$1.20". – Harshit Jun 07 '20 at 08:14