Skip to content

Commit

Permalink
Clean up npm package
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbtn committed Oct 8, 2015
1 parent 0c37fdd commit 9202c96
Show file tree
Hide file tree
Showing 8 changed files with 2,754 additions and 20 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ CNAME
index.html
robots.txt
testapp.js
index.coffee
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ Changes to the core js library live in the master branch.
npm install excel-formula

##Installation
1. Save excelFormulaUtilities-[version].js(For dev) or excelFormulaUtilities-[version].js.min (For prod).
2. Save excelFormulaUtilities.css if you'd like basic styling when outputting formulas to html.
3. Drop these files into your project.

1. Grab excel-formula.js from dist/*

Check out the examples below or if you'd like to use the beautifier online click here http://excelformulabeautifier.com/

##Basic usage

This will return a formated formula in plain text.
Expand All @@ -32,17 +30,17 @@ To see this example check out ./examples/basic_example1/index.html
var formula_1 = 'SUM((A1:A10>=5)*(A1:A10<=10)*A1:A10)';
document.getElementById('fomatFormula_1').innerHTML = formula_1;
document.getElementById('fomatFormula_1_out').innerHTML = excelFormulaUtilities.formatFormula(formula_1);

//Beautify an Excel formula output to html.
var formula_2 = '=RIGHT(A2,LEN(A2)-FIND("*",SUBSTITUTE(A2," ","*",LEN(A2)-LEN(SUBSTITUTE(A2," ","")))))';
document.getElementById('fomatFormula_2').innerHTML = formula_2;
document.getElementById('fomatFormula_2_out').innerHTML = excelFormulaUtilities.formatFormulaHTML(formula_2);

//Convert an Excel formula to C#
var formula_3 = '=IF(A2:A3="YES","A2 equals yes", "A2 does not equal yes")';
document.getElementById('fomatFormula_3').innerHTML = formula_3;
document.getElementById('fomatFormula_3_out').innerHTML = excelFormulaUtilities.formula2CSharp(formula_3);

//Convert an Excel formula to JavaScript
var formula_4 = 'ADDRESS(ROW(DataRange2),COLUMN(DataRange2),4)&":"&ADDRESS(MAX((DataRange2<>"")*ROW(DataRange2)),COLUMN(DataRange2)+COLUMNS(DataRange2)-1,4)';
document.getElementById('fomatFormula_4').innerHTML = formula_4;
Expand All @@ -54,18 +52,18 @@ To see this example check out ./examples/basic_example1/index.html
<h2>excelFormulaUtilities.formatFormula( "<span id="fomatFormula_1"></span>" );</h2>
<pre id="fomatFormula_1_out"></pre>
</div>

<div class="formula">
<h2>excelFormulaUtilities.formatFormulaHTML( "<span id="fomatFormula_2"></span>" );</h2>
<pre id="fomatFormula_2_out"></pre>
</div>

<div class="formula">
<h2>excelFormulaUtilities.formula2CSharp( "<span id="fomatFormula_3"></span>" );</h2>
<div id="fomatFormula_3_out"></div>
</div>

<div class="formula">
<h2>excelFormulaUtilities.formula2Javascript( "<span id="fomatFormula_4"></span>" );</h2>
<pre id="fomatFormula_4_out"></pre>
</div>
</div>
Loading

0 comments on commit 9202c96

Please sign in to comment.