Fork me on GitHub

Quick (Acid Test) Ratio

Enter numerical values into each field





Wikipedia Formula (3 values)
[a / c] : [b / c] : [c/c]
Results

Wikipedia Formula
[(a+b) / c] : [c/c]
Results

Bankrate Formula
[(a-b) / c] : [c/c]
Results

Formulas derived from Wikipedia and Bankrate.




JavaScript Code (sample)

script.js

function calculateRatio() {

   // Wikipedia Formula
   var d = ((a + b) / c) + ":";
   $('span#form2').text(d+e);

   // Bankrate Formula
   var f = ((a - b) / c) + ":";
   $('span#form1').text(f+e);
}



Cascading Style Sheet (sample)

style.css

.code {
  max-width:400px;
  text-align:left;
  margin:-15px auto 0 auto;
  padding: 16px 0 10px 30px;
  background-color:darkgrey;
  color: white;
  font-size:12px;
  border-radius:20px;
  border: 2px dotted PeachPuff;
}

.code h3 {
  color:skyblue;
  font-size:14px;
}



MIT License

MIT License

Copyright (c) 2017 Mike Stratton www.mikestratton.net

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.