How do I convert probability into z-score
<p>Javascript></p>

<p>If you are in the data science industry, you would be bothered if you don't have normal distribution table. I came across the article in Stackoverflow that converts z-score to probability in JavaScript. What I really want to know is the <strong>reverse calculation</strong> of this function.</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>/**
 * @param {number} z - Number of standard deviations from the mean.
 */
function GetZPercent(z) {
   // If z is greater than 6.5 standard deviations from the mean
   // the number of significant digits will be outside of a reasonable 
   // range.
   if (z &lt; -6.5)
     return 0.0;

   if (z &gt; 6.5)
     return 1.0;

   var factK    = 1;
   var sum      = 0;
   var term     = 1;
   var k        = 0;
   var loopStop = Math.exp(-23);
   
   while (Math.abs(term) &gt; loopStop) {
     term = 0.3989422804 * Math.pow(-1, k) * Math.pow(z, k) / (2 * k + 1) /
            Math.pow(2, k) * Math.pow(z, k + 1) / factK;
     sum += term;
     k++;
     factK *= k;
   }

   sum += 0.5;

   return sum;
 }</code></pre>
</div>
</div>
</p>

<p>I have a sense of how to convert z-score into the probability. But, I have no idea how to calculate the z-score(Standard deviation) from corresponding probability in javascript. For example, If I put in 0.95 (or 95%), I can expect to get 2.25 standard deviation. Above code gives me 95%, if I enter 2.25.</p>