<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Comments on snippet: 'ascii progress bar'</title>
<link>http://snipplr.com</link>
<description>Snipplr comments feed'</description>
<language>en-us</language>
<pubDate>Sat, 25 May 2013 17:42:33 GMT</pubDate>
<item>
<title>novalis78 said on 9/15/10</title>
<link>http://snipplr.com/view/21366/ascii-progress-bar/</link>
<description><![CDATA[ newer version:

===
how to use:
AsciiBar bar = new AsciiBar(1);
int cnter = 0;
foreach(Item i in items)
{
                cnter++;
                bar.AsciiProgressBar2(litems.Count, cnter);
}
===

/// 
        /// Paints an ascii progress bar based on the two input values
        /// 
        /// 
        /// 
        public void AsciiProgressBar(int total_size, int current_size)
        {
            double percent = 0.0;
            int count = current_size;
            string output = "";
            double onePercent = (total_size / 100.0);
            percent = System.Math.Round(current_size / onePercent, 2);

            if (percent >= upping)
            {
                upping += 2;
            }
            else if(percent < stepsOnScreen)
            {
                output = "\r" + percent + "%\t[";
                for (int f = upping; f < sizeOfBar; f++)
                    output += "_";
                output += "]";
                Console.Write("\r + " + output);
            }
            else if (percent >= 99.99)
            {
                output = "\r" + "DONE!" + "%\t[";
                for (int i = 0; i ]]></description>
<pubDate>Wed, 15 Sep 2010 04:50:56 GMT</pubDate>
<guid>http://snipplr.com/view/21366/ascii-progress-bar/</guid>
</item>
</channel>
</rss>