Jump to content
UBot Underground

[SOLVED] Trying to get Percentage.


Recommended Posts

I'm scraping two numbers from a website, putting each number into a table using "set table cell".  The third cell I want to be the percentage, so cell 2/cell 1.

 

When I try doing divide "table cell 2" / "table cell 1" I get "cannot divide two strings".  So I took the two numbers and used "set" to make them variables.  Then tried using "set table cell" doing divide "variable 2" / "variable 1", yet I still get "cannot divide two strings".

 

So then I tried using "Set" to create a third variable, with both the divide using table cell and divide using variables, and I still get "cannot divide two strings".

 

So, if I have two numbers, how do I get a percentage, how do I divide the two numbers?

 

Thanks,

Richard

Link to post
Share on other sites
  • 4 years later...

Sorry, found the answer by searching.  Thanks.

and the answer is?

 

I am trying to simply divide two numbers and its driving mental trying to look for answer.

 

I can see its possible to add numbers. multiple numbers. Subtract numbers. but divide number? Is a mystery.

Link to post
Share on other sites

why is divide a mystery? it is the same as the rest.

 

in most fields just put

4/2

so use  the

/

to divide.

 

Regards,

Nick

 

I am using code view. 

 

EG: set(#this_file_size_mb,$eval($divide(#file_size,1024)),"Global")

 

This does not seem to work even when #file_size is a numeric value.

Link to post
Share on other sites

I am using code view. 

 

EG: set(#this_file_size_mb,$eval($divide(#file_size,1024)),"Global")

 

This does not seem to work even when #file_size is a numeric value.

 

Works fine for me and you don't even need the eval in that case:

set(#file_size,55548,"Global")
set(#this_file_size_mb,$divide(#file_size,1024),"Global")
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...