cancel
Showing results for 
Search instead for 
Did you mean: 

How to store fraction number in data item after reading through "Read" action.

SwatiAgrawal
Level 5
Hi,

I have a bot which reads fraction numbers like 0/1 or  0/6 or 1/6 or 0/0.
When I read this and store it in a data item then it gives error because data item can read only numbers, text but not fractions. Can you please suggest how do I store fractional numbers in data items.

Thanks in advance.

------------------------------
Swati Agrawal
------------------------------
5 REPLIES 5

John__Carter
Staff
Staff
Read the fraction characters into a text data item, split the numerator and denominator into number data items, then calculate the result of the division.

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------

Hi Swati

You could use a combo of mid and tonumber to do this, read your fraction to a text data item then in a calculation stage enter this ToNumber(Mid("1/3", 1, 1))/ToNumber(Mid("1/3", 3, 1)). This will read the first number and divide it by the last number, you might want to add a trim into this though in case there are any spaces from the ocr read. Obviously just replace the fraction here with your data item.

Hope this helps 🙂

------------------------------
Michael ONeil
Technical Lead developer
Everis Consultancy
Europe/London
------------------------------

​Hi,
But I don't see any option for reading as text data item.
19779.png

------------------------------
Swati Agrawal
------------------------------

Hi Swati

The "Get current value" will read the item but you set you data item to be text. In this case you data item is called "Value from search count" you need to set this to be text and the read will pass it into this.

------------------------------
Michael ONeil
Technical Lead developer
Everis Consultancy
Europe/London
------------------------------

Thanks. It helped :)​

------------------------------
Swati Agrawal
------------------------------