"use strict";

var _tape = _interopRequireDefault(require("tape"));

var _formatPercent = require("./format-percent");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const tests = [[0.00234567, '0.23%'], [0.00234567, '0.235%', 3], [0.00234567, '0.23457%', 5], [3.5 / 11, '32%', 0], [3.5 / 11, '31.8%', 1], [3.5 / 11, '31.82%', 2]];
(0, _tape.default)('formatPercent', t => {
  tests.forEach(([input, output, precision]) => {
    t.equal((0, _formatPercent.formatPercent)(input, precision), output, "".concat(input, " should be ").concat(output));
  });
  t.end();
});