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

Convert float type in 2 decimal place?

samhopealpha
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

Gergely Szabo
VIP Alumni
VIP Alumni

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

Gergely Szabo
VIP Alumni
VIP Alumni

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.

Thanks a lot ! it's work perfectly!

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: