senik148 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Perl Monks.

in perl is there modules. or existing code. to enter a percentage for example: 80% and bring a graphic bar showing that percentage. like the ones used for cPanels and stuff.

||||||||||||||||| 70% complete

and that bar will have color etc. it has to show the full bar + color percentage of 70% use of the bar.
but my big problem was i have a list of projects for example:

project xml: 40% project html: 70% project flash: 15% project video: 6%

how can i convert all that into a summary percentage. i.e.
Full project: 45% completed


my brain hurts! help!

ruben r.

Replies are listed 'Best First'.
Re: a percent bar
by davido (Cardinal) on Dec 29, 2005 at 08:11 UTC
Re: a percent bar
by planetscape (Chancellor) on Dec 29, 2005 at 08:33 UTC
Re: a percent bar
by 0xbeef (Hermit) on Dec 29, 2005 at 09:46 UTC
Re: a percent bar
by negation (Beadle) on Dec 29, 2005 at 08:36 UTC
    A very simple way to calculate the overall percentage is just to sum percentages of projects and divide the result by amount of projects. In your case it would be: (40% + 70% + 15% + 6%) / 4 = 32.75% That assumes that you consider each project to be equal in size or amount of required work. If that is not the case, you could add appropriate weights to project percentages before summing them up. I hope that helps.
      i tried CGI::Progressbar, not what i look for.
      it does a loading percentage, i want mine not to load just to display.

      i found this: Percent Bar Maker

      i guess ill be working with that in perl.

      thanx for your help!