cancel
Showing results for 
Search instead for 
Did you mean: 

Decimal removal

Former Member
0 Kudos

Hi,

I have this currPrice 28771.16 but I need to remove the decimal i.e 2877116. I have done it but my solution also removes all the digits after the decimal which I don't want to remove.

Anyone know how?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi Sonny,

Multiply that number with 100.

Use the standard arithmetic function multiply

28771.16

Multiply Target

100

Regards

Ramesh

former_member200962
Active Contributor
0 Kudos

How to handle the situation when input is 123456.789?

Former Member
0 Kudos

Hi Abhi,

This amount is related to the currency.

Currency value not occure more than 2 digits after the decimal, thats why i mentioned multiply by 100.

We can use replace function also, here we use the first input as actual input field, 2nd field as . and replaced string(3rd input) is empty then 123.15 becomes 12315, because . is replaceb by empty.

Regards

Ramesh

Answers (3)

Answers (3)

Shabarish_Nair
Active Contributor

>

> Hi,

> I have this currPrice 28771.16 but I need to remove the decimal i.e 2877116. I have done it but my solution also removes all the digits after the decimal which I don't want to remove.

>

> Anyone know how?

>

> Thanks

go for the simplest solution as already mentioned by Abhishek. Use the standard string function, replaceAll and replace . with and empty string and you should be good

Former Member
0 Kudos

Hi,

Could you please be a little more specific how to map the function ReplaceString? because it has thre inputs

Shabarish_Nair
Active Contributor
0 Kudos

in your case,

first would be the actual field, second will be . and third will be an empty constant

http://help.sap.com/saphelp_nw04/helpdata/EN/43/c4cdfc334824478090739c04c4a249/content.htm -> Function Category: Text

abhijitbolakhe
Advisor
Advisor
0 Kudos

Hi

use Replacestring text function

map first field --- actual field

second----- . (decimal)

third -


(blank)

http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm

If need UDF to remove decimal, check the below link

Replacestring will solve your issue

Regards

Abhijit

Edited by: Abhijit Bolakhe on Dec 1, 2009 4:40 PM

Edited by: Abhijit Bolakhe on Dec 1, 2009 4:47 PM

former_member200962
Active Contributor
0 Kudos

Did you use the standard function Replace string...available in Message Mapping itself?

Regards,

Abhishek.