Handsontable Basic Example (100x10)

by handsoncode

HTML

<script src="https://cdn.jsdelivr.net/npm/hyperformula/dist/hyperformula.full.min.js"></script>
<script src="https://handsontable.com/docs/scripts/fixer.js"></script>

CSS

.htSelectEditor {
  /*
   * This hack enables to change <select> dimensions in WebKit browsers
   */
  -webkit-appearance: menulist-button !important;
  position: absolute;
  width: auto;
  z-index: 300;
}

Babel + JSX

import { HyperFormula } from 'hyperformula';


    const hfInstance = HyperFormula.buildFromArray([], {
      licenseKey: 'gpl-v3'
    });

    const goodFormula = '=SUBSTITUTE("13x", "x", "x00")';
    const result1 = hfInstance.calculateFormula(goodFormula, 0);
		console.log(result1)

    // in the formula below I was expecting it to behave
    // just like the one above, but it doesn't.
    // it returns ".00.00.00"
    const badFormula = '=SUBSTITUTE("13.", ".", ".00")';
    const result2 = hfInstance.calculateFormula(badFormula, 0);
		console.log(result2)