cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
1105
Views
5
Helpful
4
Replies

CVP Math Element adds ".0" to results?

I'm currently working on a CVP Studio app to record emergency messages with a timeout, and I'm running into something very frustrating with the Math element: It always outputs its results as a float! So for example I'll add 2 hours to the current time's hour, and get "12.0" instead of "12". I'd like to take the ".0" off of these results, but I don't see any way to do this without doing custom Java. Even using a Data tab to record the value into an Integer, it still keeps the ".0" on the data.

Here's a couple lines from the activity log... first one is the Math element, the second is the data tab of an Application Modifier storing the result into an Integer:

02/17/2014 10:11:08.763,DecrementHour,enter,

02/17/2014 10:11:08.763,DecrementHour,custom,Result,1.0

02/17/2014 10:11:08.763,DecrementHour,exit,done

02/17/2014 10:11:08.763,FormatDateTime,data,Hour,1.0

Anyone know a way to keep the ".0" out without building custom Java for this?

-Jameson
1 ACCEPTED SOLUTION

Accepted Solutions

If you're always subtracting an integer from an integer, you could use a Counter element. Use the Settings tab to set the function to Decrement, and use variables for the Initial Count and the Step size. The result will be an Integer and stored into Element data. You can then use the Data tab to assign that value into your own Session variable.

Hope that helps.

View solution in original post

4 REPLIES 4
dlender
Frequent Contributor

See the description of the Math element.

Element Specifications for Cisco Unified CVP VXML Server and Cisco Unified Call Studio Release 10.0(1) - Math [Cisco Uni…

It shows that the result is a Double value and the result of 2*4 = 8.0

Yes, I noticed that.

I guess my question is more along the lines of: Is there any way to change the double value to an integer using something else in CVP Call Studio? I would have expected that storing the value into Session Data as type Integer would store 8.0 as 8, but it doesn't appear that way in the activity log.

-Jameson

If you're always subtracting an integer from an integer, you could use a Counter element. Use the Settings tab to set the function to Decrement, and use variables for the Initial Count and the Step size. The result will be an Integer and stored into Element data. You can then use the Data tab to assign that value into your own Session variable.

Hope that helps.

View solution in original post

That works perfectly, Janine! Thanks for your help.

-Jameson
Create
Recognize Your Peers
Content for Community-Ad