We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Converting String to Numbers

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
amitkhosla
Posts: 53
Joined: Sun Feb 15, 2009 11:42 pm
Contact:

Converting String to Numbers

Post by amitkhosla »

I have a requirement where we ask the user to enter the time before which he want the alert. He can say time like "15 minutes" for which i have written the below mentioned grammer. But this takes the input as "fifteen minutes". Now fifteen i want as 15. Is there any way by which i can get 15 in numerals.

Else is thr a way to convert covert fifteen to 15? I'll be very thankful to you.

<field name="reminderTime">
<prompt>
Please say the time before which we should alert you for the appointment.
For Example, for 15 minutes, say 15 minutes. For 1 week, say 1 week.
</prompt>
<grammar root="main" type="application/srgs+xml" mode="voice">
<rule id="main" scope="public">
<ruleref uri="builtin:grammar/number?minallowed=1;maxallowed=100;maxdecimal=0"/>
<item>
<one-of>
<item>day</item>
<item>days</item>
<item>week</item>
<item>weeks</item>
<item>month</item>
<item>months</item>
<item>hour</item>
<item>hours</item>
<item>minute</item>
<item>minutes</item>
</one-of>
</item>
</rule>
</grammar>
<filled>

</filled>
</field>

Post Reply