cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
258
Views
0
Helpful
2
Replies
Highlighted
Beginner

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
Advocate

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.

View solution in original post

2 REPLIES 2
Advocate

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.

View solution in original post

Beginner

Convert float type in 2 decimal place?

Thanks a lot ! it's work perfectly!

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards