Math plugin help
Hello all.
Well I made a little nsis script to read all txt files in a folder, inspecting them based on some criteria. This works just fine. The inspection process takes place in a function, and therefore the progress bar does not accurately display the true progress of the script.
What I would like to do is use Stu's RealProgress plug-in to manually set the progress bar. My strategy (feel free to offer up an alternative) is to get then number of files in the folder, say 250, then divide by 100, giving me 2.5 in this case.
Then after checking each file, I do this:
(after 1 file checked)
$NumFilesChecked/2.5 = .4 --> rounded = $CurrentProgress
RealProgress::SetProgress /NOUNLOAD $CurrentProgress
(after 2 files checked)
$NumFilesChecked/2.5 = .8 --> rounded = $CurrentProgress
RealProgress::SetProgress /NOUNLOAD $CurrentProgress
(after 3 files checked)
$NumFilesChecked/2.5 = 1.2 --> rounded = $CurrentProgress
RealProgress::SetProgress /NOUNLOAD $CurrentProgress
Ok, so you get it right. If this is an acceptable strategy for manually setting the RealProgress bar, I just need the syntax for using the Math Plug-in to do decimal division, and rounding (separately).
I have searched like crazy, but just can't seem to understand the math::script usage, can you help me? Thanks all for looking.
Jnuw