Posts / moneyToCell#16

Money to cell (table renderer)

By Toby Hinloopen at 2021-03-19 16:46

Installation

# npm
npm i https://boomm.io/p/16-money-to-cell.tar.gz
# yarn
yarn add https://boomm.io/p/16-money-to-cell.tar.gz

Usage

const moneyToCell = require("16-money-to-cell");

Source

module.exports = function moneyToCell(num) {
  return [num < 0 ? "-" : "", Math.abs(num).toFixed(2)];
}