JSPM

thepricer-utils

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q55821F
  • License MIT

Tiny helpers for price explainers: formatPrice, midpoint, hoursToAfford.

Package Exports

  • thepricer-utils

Readme

thepricer-utils

Tiny helpers for price explainers: formatPrice, midpoint, hoursToAfford
Homepage: https://www.thepricer.org/

Install

npm install thepricer-utils

Usage

import { formatPrice, midpoint, hoursToAfford } from "thepricer-utils";

console.log(formatPrice(12.5, { currency: "$", per: "lb" })); // "$12.50 per lb"
console.log(midpoint(9, 11));                                 // 10
console.log(hoursToAfford(28.5, 15));                         // 1.9