cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
603
Views
0
Helpful
2
Replies

UCCX scripting - Split lagre intiger to more piece

glostertelekom
Level 1
Level 1

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

 

1 Accepted Solution

Accepted Solutions

Anthony Holloway
Cisco Employee
Cisco Employee

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)])

 

View solution in original post

2 Replies 2

Anthony Holloway
Cisco Employee
Cisco Employee

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)])

 

Hi Anthony,

 

Thank you for your quick answer and your help, you solved my problem.

 

Cheers,

Attila

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: