Sign in to follow this  
Followers 0
ghetek

converting to percentage

5 posts in this topic

ive got this. $sssize is just the inetgetsize of the file that is being downloaded.

$currentsspercent = @InetGetBytesRead / $sssize

I have the $currentsspercent reporting back every 4 seconds in a traytip but i get a number like 0.293423423432. i know i need to strip the string but im drawing a blank as to how to turn that number into a percent. help?

Share this post


Link to post
Share on other sites



ive got this. $sssize is just the inetgetsize of the file that is being downloaded.

$currentsspercent = @InetGetBytesRead / $sssize

I have the $currentsspercent reporting back every 4 seconds in a traytip but i get a number like 0.293423423432. i know i need to strip the string but im drawing a blank as to how to turn that number into a percent. help?

$currentsspercent = @InetGetBytesRead / $sssize * 100


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

$currentsspercent = @InetGetBytesRead / $sssize * 100

ugh... i feel soooo stupid

Share this post


Link to post
Share on other sites

ugh... i feel soooo stupid

Actually you may want to go with:

$currentsspercent = Round(@InetGetBytesRead / $sssize * 100,0)

to kill your decimal, or another number depending on the precision that you want ",2" for accuracy to the hundreths of a percent etc...


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

maybe this could help

While @InetGetActive
        ProgressSet(@InetGetBytesRead / $Size * 100,Round( @InetGetBytesRead / $Size * 100,0) & " %")
        Sleep(250)
    Wend

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0