How to find out number of decimals and length of message

Dear all,

I have to problems when integrating our legacy system to SAP (Unit of measure conversion factors):

  1. Find out number of decimals : If I get a field containing a number with decimals I need to find out how many decimals I have to multiply this with 10; 100; 1000 … As result I need a number without decimals.

  2. This is related to the first issue. If I get a number with more than 5 digits I have to divde throut 10,100, 1000,… to get a number with max five digits in front of the comma/point.

I think the loop for multiplying or dividing is something I know how to realize but I did not find any service to extract number of decimals and/or total length of numbers

you can replace the . in the number to get the integer value

Ex: 1234.56789

if you replace the . in the above number with “” you will get 123456789 as result.

use pub.string.length to get the total length of the string.

I need to know the number of decimals as well. Is there a service to count up to a special character like “.”? Than I could easily count the decimals (thanks to show me the length- service). Substring does not work for this operation.

Any other idea?


use pub.string.indexOf