To extract each digit from a number data item
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-07-20 11:09 AM
I am creating a process Toto check for Armstrong's Number, where one need to extract each digit from a number data item in order to do the following calculation
Amstrongnumber
Ex:- 345
If sum of (3*3*3) + (4*4*4) + (5*5*5) = 345
------------------------------
Mayank Sinha
------------------------------
Amstrongnumber
Ex:- 345
If sum of (3*3*3) + (4*4*4) + (5*5*5) = 345
------------------------------
Mayank Sinha
------------------------------
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
23-07-20 07:56 PM
Hi Mayank,
Here are two ways you could do this:
Option 1:
Using Utility - Strings VBO, Split Lines by Length and set maximum line length to 1. The input value has to be text data type for this to work.
Option 2:
Get the length of the integer with the Len() text function.
Then use the Mid text function to iterate through the data item with length set to 1 character. Start with the first character and stop when you have reached the last character (which is the same as the length).
You would also need to check if it's a negative integer and disregard the minus sign.
------------------------------
Patrick Aucoin
Senior Product Consultant
Blue Prism
------------------------------
Here are two ways you could do this:
Option 1:
Using Utility - Strings VBO, Split Lines by Length and set maximum line length to 1. The input value has to be text data type for this to work.
Option 2:
Get the length of the integer with the Len() text function.
Then use the Mid text function to iterate through the data item with length set to 1 character. Start with the first character and stop when you have reached the last character (which is the same as the length).
You would also need to check if it's a negative integer and disregard the minus sign.
------------------------------
Patrick Aucoin
Senior Product Consultant
Blue Prism
------------------------------
