Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Progress Bar - Show progress of result compared to 0

Hey HF! Not too sure how else to word this, so here we go:

X = 54879
X will be eventually mathematically reduced to 0.

example: (don't worry about the math part, these #'s are just for demonstration)

54879 - %?
math
53403 - %?
math
48392 - %?
math
25832 - %?
math
823 - %?
math
20 - %?
math
0 - 100%

How can I show the progress towards 0 via a progress bar?

Thank you very much in advanced!!🎉
.-=~
548.79 is one percent (1%) so just divide the number you have by 548.79, optionally round it, and then you have the percentage.
This is actually way easier than you probably expected, you're just over thinking it.

Calculate the progress as normal (as if you were counting up to the max value):

Code
Dim Maximum As Integer = 54879
Dim Value As Integer = 15000

Dim Progress As Double = Value / Maximum * 100

Then, once you have the Progress, simply subtract it from 100.

Code
Dim NewProgress As Double = 100 - Progress 'Returns 72.66%
(Oct 15, 2015 11:48 AM)6e756c6c Wrote:  This is actually way easier than you probably expected, you're just over thinking it.

Calculate the progress as normal (as if you were counting up to the max value):

Code
Dim Maximum As Integer = 54879
Dim Value As Integer = 15000

Dim Progress As Double = Value / Maximum * 100

Then, once you have the Progress, simply subtract it from 100.

Code
Dim NewProgress As Double = 100 - Progress 'Returns 72.66%

Thank you very much for your response!
I guess I was overthinking it haha, not sure why my I'm a bit brain-dead today. 😝
Anyways, thanks again & have an awesome day! 👍
.-=~


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by Nemo2478Jul 25, 2020 12:01 PM 1 177 Jul 25, 2020 12:01 PM
Last Post: glitchgxd
[Python] by Freed0m36Nov 22, 2018 02:59 AM 7 200 Nov 22, 2018 02:59 AM
Last Post: PoP-Hacker
[Shell] by HackooMar 29, 2018 04:04 AM 5 289 Mar 29, 2018 04:04 AM
Last Post: Hackoo