cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement the logic of devide with 1000 in PI?

former_member262051
Participant
0 Kudos

HI Experts,

I have requirement that need to divide the value with 1000 when ever the field value has five numeric digits. The value will be like

1. 12.123415

2. 123.12312322

3. 1.2312

4. 12345.5678922

But  the logic of divide with 1000 has to applicable at case: 4 only.

Please help me here.

Regards,

uday

Accepted Solutions (1)

Accepted Solutions (1)

vadimklimov
Active Contributor
0 Kudos

Hi Uday,

You can achieve this with small user defined function using BigDecimal:

If you know scaling factor of expected decimal values, you can adopt code accordingly to reflect it, otherwise keep it generic.

Please ensure you add import of class java.math.BigDecimal in imports section of your UDF, by default package java.math is not imported in UDFs.

Regards,

Vadim

former_member262051
Participant
0 Kudos

Thanks a lot Vadim Klimov,

Issue resolved now.

Regards,

Uday.

Answers (0)