Calculator

From Peace Corps Wiki

(Difference between revisions)
Jump to: navigation, search
Line 24: Line 24:
<li>Some countries are new to have volunteers, but are not yet reflected in the data
<li>Some countries are new to have volunteers, but are not yet reflected in the data
<li>Applicants can use the <a href="http://peacecorpswiki.org/Timeline" target="_blank">Timeline</a> page to compare countries listed with dates of departure
<li>Applicants can use the <a href="http://peacecorpswiki.org/Timeline" target="_blank">Timeline</a> page to compare countries listed with dates of departure
 +
<li>Countries not belonging to certain criteria can be deleted from the list by clicking the radio button on the left
</ul>
</ul>
</ul>
</ul>
Line 71: Line 72:
</form>
</form>
-
  <div id = "dv">
 
   <table id="OutputTable" border="1">
   <table id="OutputTable" border="1">
   </table>
   </table>
-
  </div>
+
 
</center>
</center>
Line 133: Line 133:
//Add Bottom row
//Add Bottom row
var x=document.getElementById('OutputTable').insertRow(1);
var x=document.getElementById('OutputTable').insertRow(1);
-
var c1=x.insertCell(0);
+
var c0=x.insertCell(0);
-
var c2=x.insertCell(1);
+
var c1=x.insertCell(1);
-
var c3=x.insertCell(2);
+
var c2=x.insertCell(2);
 +
var c3=x.insertCell(3);
 +
c1.innerHTML=" ";
c1.innerHTML="<b>TOTAL</b>";
c1.innerHTML="<b>TOTAL</b>";
c2.innerHTML="<b>"+sum+"</b>";
c2.innerHTML="<b>"+sum+"</b>";
Line 145: Line 147:
{
{
var x=document.getElementById('OutputTable').insertRow(1);
var x=document.getElementById('OutputTable').insertRow(1);
-
var c1=x.insertCell(0);
+
var c0=x.insertCell(0);
-
var c2=x.insertCell(1);
+
var c1=x.insertCell(1);
-
var c3=x.insertCell(2);
+
var c2=x.insertCell(2);
 +
var c3=x.insertCell(3);
 +
c0.innerHTML='<input type="radio" value="Delete" onclick="deleteRow(this)">'
c1.innerHTML='<a href="http://www.peacecorpswiki.org/'+country[i]+'" target="_blank">'+country[i]+'</a>' ;
c1.innerHTML='<a href="http://www.peacecorpswiki.org/'+country[i]+'" target="_blank">'+country[i]+'</a>' ;
c2.innerHTML=numvol[i];
c2.innerHTML=numvol[i];
c3.innerHTML=Math.round(100*numvol[i]/sum);
c3.innerHTML=Math.round(100*numvol[i]/sum);
}
}
 +
 +
var x=document.getElementById('ExampleTable').insertRow(0);
 +
var c0=x.insertCell(0);
 +
var c1=x.insertCell(1);
 +
var c2=x.insertCell(2);
 +
var c3=x.insertCell(3);
 +
c0.innerHTML=" ";
 +
c1.innerHTML="<b>Country</b>";
 +
c2.innerHTML="<b>Number of vols</b>";
 +
c3.innerHTML="<b>Percentage</b>";
}
}
Line 168: Line 182:
{
{
var x=document.getElementById('OutputTable').insertRow(0);
var x=document.getElementById('OutputTable').insertRow(0);
-
var c1=x.insertCell(0);
+
var c0=x.insertCell(0);
-
var c2=x.insertCell(1);
+
var c1=x.insertCell(1);
-
var c3=x.insertCell(2);
+
var c2=x.insertCell(2);
 +
var c3=x.insertCell(3);
 +
c0.innerHTML=" ";
c1.innerHTML="<b>Country</b>";
c1.innerHTML="<b>Country</b>";
c2.innerHTML="<b>Number of vols</b>";
c2.innerHTML="<b>Number of vols</b>";
Line 176: Line 192:
}
}
-
 
+
function deleteRow(r)
 +
{
 +
var i=r.parentNode.parentNode.rowIndex;
 +
document.getElementById('OutputTable').deleteRow(i);
 +
//Now recalculate percentages
 +
//Number of rows (new)
 +
var oRows = document.getElementById('OutputTable').getElementsByTagName('tr');
 +
var iRowCount = oRows.length;
 +
//Initialize
 +
var sum=0;
 +
var numvol=0;
 +
//Find new sum
 +
for (i=1;i<=iRowCount-2;i++)
 +
{
 +
var x=document.getElementById('OutputTable').rows[i].cells;
 +
numvol=x[2].innerHTML;
 +
sum=parseInt(sum)+parseInt(numvol);
 +
}
 +
//Assign new sum
 +
var x=document.getElementById('OutputTable').rows[iRowCount-1].cells;
 +
x[2].innerHTML='<b>'+sum+'</b>';
 +
//Assign new percentages
 +
for (i=1;i<=iRowCount-2;i++)
 +
{
 +
var x=document.getElementById('OutputTable').rows[i].cells;
 +
numvol=x[2].innerHTML;
 +
x[3].innerHTML=Math.round(100*numvol/sum);
 +
}
 +
}
Line 928: Line 972:
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
</body></html></addhtml>
</body></html></addhtml>
 +
 +
[[Category:resources]]
[[Category:resources]]
[[Category:FOIA Documents]]
[[Category:FOIA Documents]]

Revision as of 16:54, 11 May 2010

<addhtml>

Click to use an actual calculator
Peace Corps Calculator
(Note: Uses Javascript)

On the Peace Corps' Open Government Initiative website there are links at the bottom to .csv files, including one for "2009 Peace Corps Volunteer on board strength - by post and sector" (also available here). This page uses that data in its computations of volunteer placements.
DATA AS OF 2009

  • Select a region and sector to see the number, and percentage, of volunteers within that region with that job sector
  • Example: In 2009 there were 383 'Education' volunteers in 'Asia', of which 110 of them (29%) were in China
  • This can also be used as a GUIDE to where future Applicants may be placed
    • Data is based an actual distribution of volunteers in 2009
    • Some countries listed may have been suspended or evacuated.
    • Some countries are new to have volunteers, but are not yet reflected in the data
    • Applicants can use the Timeline page to compare countries listed with dates of departure
    • Countries not belonging to certain criteria can be deleted from the list by clicking the radio button on the left

World Region:

Job Sector:













</addhtml>

Personal tools
Namespaces
Variants
Actions
Tell Your Friends
Navigation
Peace Corps News
Timelines
Country Information
Groups
Help
About
Toolbox