cancel
Showing results for 
Search instead for 
Did you mean: 

Remove decimal from input field

badugu_sarika
Participant
0 Kudos

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


Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Glad that it's working.

Regards

Baski

Answers (2)

Answers (2)

former_member399415
Discoverer
0 Kudos

Hi Sarika,

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

Regards,

Sanjeev

badugu_sarika
Participant
0 Kudos

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

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

Baski

badugu_sarika
Participant
0 Kudos

Hi Baskar,

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

Thanks

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.

badugu_sarika
Participant
0 Kudos

Hi Baskaran,

Its perfectly working,

Thanks for your valuable inputs.

I am unable to select as correct answer for your comment

Please comment separately so that i can give you credits.

SARIKA

former_member190293
Active Contributor
0 Kudos

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.