Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 360
  • Last Modified:

vb.net - perfecnt counter

hello there,
I would like to create a percent counter..
I have two counter that check for file size. if file size is bigger then 1MB then
Big.Text += 1
if file size is smaller than 1MB then
Small.Text += 1
how can I have a percentage that show like %95 etc.. ?
2 Solutions
VB isn't my main language so this is air code

dim i as integer, s as string
i = 95
s = "%" + i.ToString()

should result in s being %95
Paul MacDonaldDirector, Information SystemsCommented:
This will depend on what the number is a percentage of.  I presume the ratio involves Big.text and Small.text, but are you looking for those to be percentages of each other, percentages of some total value (total number of files, total file size, etc), or something else.  

It's also possible you're asking how to show Big.text and Small.text as percentage values.  In that case what you want is the FormatPercent function, but you may want to divide your numbers by 100 first.

This question can be answered better if it's stated more clearly.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now