Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Convert float type in 2 decimal place?

Hi everybody,

I am using UCCX 9.0 and writing an AEF file

There is a float value in the AEF.

float number = 3.4586097F

is there a way to tranform it to 2 decimal place?

that is 3.46 ?

Thanks

Sam

Everyone's tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions

Convert float type in 2 decimal place?

Hi,

use the following code in a Set step:

java.lang.Math.round(num1*100.0)/100.0

This is the simplest way, although this should not be used if precise values (currency etc). But if it's not an issue, the above is relatively safe.

G.

2 REPLIES

Convert float type in 2 decimal place?

Hi,

use the following code in a Set step:

java.lang.Math.round(num1*100.0)/100.0

This is the simplest way, although this should not be used if precise values (currency etc). But if it's not an issue, the above is relatively safe.

G.

New Member

Convert float type in 2 decimal place?

Thanks a lot ! it's work perfectly!

96
Views
0
Helpful
2
Replies