Skip to Content
avatar image
Former Member

How to remove Decimal from PI mapping.

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 30, 2014 at 08:31 AM

    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


    UDF-substrng.jpg (58.9 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • Dec 30, 2014 at 09:43 AM

    Hi,

    use Arithmetic funktion "FormatNum" like this

    Regards,

    Alex


    Unbenannt.jpg (27.8 kB)
    Add comment
    10|10000 characters needed characters exceeded