Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

format-quantity

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

format-quantity - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

0

bower.json

@@ -0,0 +0,0 @@ {

7

index.d.ts
export as namespace formatQuantity;
export default function formatQuantity(qty: number): string;
/**
* Formats a number (or string that appears to be a number)
* as one would see it written in imperial measurements, e.g.
* "1 1/2" instead of "1.5".
*/
export default function formatQuantity(qty: number | string): string;

@@ -11,2 +11,8 @@ (function (global, factory) {

/**
* Determines if two numbers are close enough to consider
* them equal for our purposes
* @param {number} a first number
* @param {number} b second number
*/
var closeEnough = function (a, b) {

@@ -16,5 +22,11 @@ return Math.abs(a - b) < 0.009;

/**
* Formats a number (or string that appears to be a number)
* as one would see it written in imperial measurements, e.g.
* "1 1/2" instead of "1.5".
* @param {number|string} sInQty The quantity
*/
var formatQuantity = function (sInQty) {
sQty = sInQty;
var sQty = sInQty;

@@ -21,0 +33,0 @@ // bomb out if not a number

2

package.json
{
"name": "format-quantity",
"version": "0.3.2",
"version": "0.3.3",
"description": "Format a number as an integer plus fraction, as seen in recipe ingredient lists",

@@ -5,0 +5,0 @@ "repository": {

@@ -0,0 +0,0 @@ # format-quantity

@@ -0,0 +0,0 @@ /**

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc