title: NetLogo: Calculating a percentage
body: <p>I'm trying to calculate the percentage chance that an event occurs. I've attempted to implement this by creating two globals ("success" and "total"). Whenever the the event occurs the "success" and "total" variables increment and when the event doesn't occur (another occurs instead) only "total" is incremented.</p>
  
  <p>So to get the percentage chance this happens I need to divide the "success" variable by the "total" and multiply by 100. I also want to display this value in a monitor on the user interface so I've created another variable "percentage" to assign the calculation to so that it can be declared in the monitor.</p>
  
  <p>I've created a procedure called calculation and called it in the go procedure, however I'm not sure of the correct syntax to get what I need working. I've added some pseudo code as I believe it should work</p>
  
  <pre><code>to calculate
   set percentage (count success)/(count total)
  end
  </code></pre>