Skip to Content
0

Remove decimal from input field

Apr 04, 2017 at 01:23 PM

138

avatar image

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


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
avatar image
Former Member Apr 10, 2017 at 10:22 AM
0

Glad that it's working.

Regards

Baski

Share
10 |10000 characters needed characters left characters exceeded
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
10 |10000 characters needed characters left characters exceeded
avatar image
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
10 |10000 characters needed characters left characters exceeded

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

0
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

Baski

1

Hi Baskar,

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

Thanks

SARIKA

0
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.

1

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

0