cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove Decimal from PI mapping.

Former Member
0 Kudos

Hi Experts.

I have a mapping in which field data type is string and its length is 13. (version 7.3)

Now user passed value with decimal and they doesn't want output with decimal.

if input value is 123456789.0001 then output should come as 123456789 (we don't want round of for the value.)

Please advice me best possible solution

Regards,

Mohit Dua

Accepted Solutions (0)

Answers (2)

Answers (2)

AlexanderApel
Participant
0 Kudos

Hi,

use Arithmetic funktion "FormatNum" like this

Regards,

Alex

azharshaikh
Active Contributor
0 Kudos

Hi Mohit,

Format Num functn will round off the number.

eg: if Input  = 12345.99 Output = 12346

I suggest you use a UDF to achieve this as follows:

It will just do a Substring without rounding off

int i =0;

i =  var1.indexOf('.');

if(i>0)

return var1.substring(0, i);

else

return var1;

Regards,

Azhar

iaki_vila
Active Contributor
0 Kudos

Hi Azhar,

You are right, i haven't tested correctly the function. I'm going to delete my previous post.

Regards

azharshaikh
Active Contributor
0 Kudos

Hi Iñaki

The approach you suggested is also good..as its using Standard Graphical Function ...maybe Mohit can decide to chose the any of the solution as per his requirement.

Not sure if Mohit requirement is very critical in terms of rounding off. I just gave an alternative option to avoid rounding off.

Regards,

Azhar