08-31-2011 03:31 AM - edited 03-14-2019 08:28 AM
Hi,
I'm trying to build a script calculating the waiting time. After that I want to instruct the script to play a prompt announcing that value. My problem is that I want to announce minutes and seconds. In order to do that, I thought to get the Wait Time, divide that by 60 and then calculate how many minutes and remaining seconds left in order to announce it. For example:
WaitTime = 256 (always in seconds)
WaitTimeIn Minutes = WaitTime / 60
So, WaitTimeInMinutes will be 4.3. This means that I have 4 minutes and the rest of the seconds. In order to calculate the exact remaining seconds I do:
RemainSeconds = WaitTime - (WaitTimeInMinutes * 60)
This should give me 16 seconds, if we assume that WaitTimeInSeconds is 4 and not 4.3.
My problem is how to get only the 4 from the WaitTimeInSeconds and not 4.3. I want to discard the decimal part.
Is there any other way to make this custom prompt?
Thank you in advance.
Agelos
08-31-2011 05:53 AM
mm
I would like to introduce you to the modulus.
Example:
Set ewt = 65
Set min = ewt / 60
Set sec = ewt % 60
Sent from Cisco Technical Support iPhone App
08-31-2011 06:15 AM
Indeed.
Regards,
Geoff
08-31-2011 06:17 AM
Thanks alot Anthony.
I'll try this approach.
Agelos
09-23-2011 11:51 AM
You could also use the trunc function:
trunc(WaitTime = 256 (always in seconds))
It will trim any number down to an integer.
Peace,
Michael Clendening
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