halve

Cut A Number into Two Parts. Preserve Integer Types.

Usage no npm install needed!

<script type="module">
  import halve from 'https://cdn.skypack.dev/halve';
</script>

README

halve

Cut A Number into Two

features

  • Simple
  • Preserve Integer Types

install

npm install halve

usage

import halve from "halve";

const num = 5;

halve(num, { round: false });
// [ 2.5, 2.5 ]

halve(num { round: true });
// [3, 2]