# Set the value of a progress bar

Hi

• I need to set a value between 0 and 1 in a progress bar
• The amount of seconds will vary (they come from another function)
• I multiply the minutes by 60 then added to the seconds to get the total seconds
• I divided the total seconds to get the number that will be the 1% of the progress (not sure if this helps)

Now I need to figure out how to set the 1% to 0.01, the 2% to 0,02…and so on.

have in mind that the 1% will vary depending on the total of seconds, and the progress bar is decreasing.

Thanks!

Not sure exactly what to make of this. Seems you have it all figured out…If you are able to get the percentage dividing by 100 will give you the decimal value. So if your function outputs 1 for 1%…divide by 100 you have 0.01 and plug that into your “value” input pin for the scalar parameter. Not really sure what the problem is. Only thing I can think of, is your “countdown” isn’t working properly and thus not giving you the correct values. Like if you have a countdown of 5 minutes that would be 300 seconds. You would have to divide total seconds by 300 to get a value between 0 and 1. But what if your countdown is 2 minutes? Now you need to divide by 120 (the number of seconds in 2 minutes). I have a few tutorials that can create very nice and easy to use timers, countdowns and one that even modifies a progress bar like you seem to be trying to do. Check them out maybe you will find something that solves this issue.

it kind of sounds like your trying to normalize a value. i would suggest you look into the normalize to range node. that node basically takes in a min, max, and value then returns a 0-1 number based on the value. so the max would be your 100% and the value pin the current value.