0

# Remove decimal from input field

Apr 04, 2017 at 01:23 PM

138

Hi SCN users,

I have to send the value 2250420.00 AUD from source field to target side by removing AUD. I know i can use replace string but there are other currencies also which is coming as input apart from AUD .

So overall I need to remove whatever characters are coming like AUD ,USD,etc.

To achieve this what is to be done at mapping Level.

Need help . Can anyone help me on this.

Thanks

SARIKA

Former Member Apr 10, 2017 at 10:22 AM
0

Glad that it's working.

Regards

Share
Evgeniy Kolmakov Apr 04, 2017 at 02:40 PM
0

Hi Sarika!

If you need to remove decimal part if it has zero value you can reach it by using standard function replaceString in graphical mapping. Just replace ".00" with "".

Regards, Evgeniy.

Share
Former Member Apr 05, 2017 at 04:52 AM
0

Hi Sarika,

Adding to what Evgeniy, check if you need to do any rounding up as well.

Regards,

Sanjeev

Show 5 Share

Now the requirement is slightly changed.

I have to send the value 2250420.00 AUD removing AUD. I know i can use replace string but there are other currencies also which is coming as input apart from AUD .

So overall I need to remove whatever characters are coming like AUD ,USD,etc.

To achieve this what is to be done at mapping Level.

Thanks

SARIKA

Former Member
S Sarika

Hi Sarika,

I could see there is a space occurring between the zeros after decimal and the currency character. If that's correct, you can use the below logic in UDF.

return(Input_String.split(" ")[0]);

Regards

Former Member

The logic you mentioned will ignore the whatever String which is coming in the input.???

Thanks

SARIKA

Former Member
S Sarika

Hi Sarika,

Did you test the logic?

It will not ignore all the characters in the input string. I will ignore only the characters occurring after space. Actually the logic is simple, just splits the input string using space as a separator and returns the first part. Refer the sample data below.

Input Output

2250420.00 AUD 2250420.00

123ABC USD 123ABC

Is this what you are looking for?

If not, clarify us about you requirement.

Former Member