node.jslogicalexa-skills-kitalexa-slot

Adding two numbers concatenates them instead of calculating the sum node.js in amazon alexa skill


Adding two numbers concatenates them instead of calculating the sum node.js in amazon alexa skill I have attached some screen shot of it.

slot

here is the output image

code image

intent


Solution

  • I would suggest you using AMAZON.NUMBER as slot type. I think that will work.

    If that built-in slot is not suitable for any reason your needs then you can do Number(<slot_value>) to convert the string to a number.

    I hope this helps :D Cheers