03-14-2014 05:28 AM - edited 03-14-2019 01:15 PM
Hi All,
I have the following problem:
I have a script, that integrates with an external DB, where I'm making some parameter changes and at the end I get an intiger back from DB. This intiger is converted to a prompt and played out by the script. My problem is, that the number is 8 digit long and I would like play it out in 4 part. Every part would contain 2 digits. I write an example just to make it clear what I want:
I get the following number from the DB: 12345678.
I want to play it out in format 12, 34, 56, 78 not in 12345678.
Any help would be appreciated again! :)
Cheers,
Attila
Solved! Go to Solution.
03-14-2014 07:17 AM
If you will always get back 8 digits, then you can simply do this:
*Assume your integer variable is my_int
Play Prompt (--Triggering Contact--, N[String.valueOf(my_int).substring(0, 2)])
Play Prompt (--Triggering Contact--, N[String.valueOf(my_int).substring(2, 4)])
Play Prompt (--Triggering Contact--, N[String.valueOf(my_int).substring(4, 6)])
Play Prompt (--Triggering Contact--, N[String.valueOf(my_int).substring(6, 8)])
03-14-2014 07:17 AM
If you will always get back 8 digits, then you can simply do this:
*Assume your integer variable is my_int
Play Prompt (--Triggering Contact--, N[String.valueOf(my_int).substring(0, 2)])
Play Prompt (--Triggering Contact--, N[String.valueOf(my_int).substring(2, 4)])
Play Prompt (--Triggering Contact--, N[String.valueOf(my_int).substring(4, 6)])
Play Prompt (--Triggering Contact--, N[String.valueOf(my_int).substring(6, 8)])
03-14-2014 08:05 AM
Hi Anthony,
Thank you for your quick answer and your help, you solved my problem.
Cheers,
Attila
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide