I\'m trying to convert a percentage to a progress bar and I\'ve written the code but I believe that it can be improved and made a lot smaller.
If the total chars are 10,