format-quantity
Advanced tools
Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "format-quantity", | ||
"main": "index.js", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"homepage": "https://github.com/jakeboone02/format-quantity", | ||
@@ -6,0 +6,0 @@ "authors": [ |
{ | ||
"name": "format-quantity", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Format a number as an integer plus fraction, as seen in recipe ingredient lists", | ||
@@ -5,0 +5,0 @@ "repository": { |
# format-quantity | ||
### Installation: | ||
### Installation | ||
##### npm | ||
https://www.npmjs.com/package/format-quantity | ||
``` | ||
@@ -9,9 +13,20 @@ npm i --save format-quantity | ||
### Usage: | ||
##### Browser | ||
In the browser, available as a global function `formatQuantity`. | ||
``` | ||
var formatQuantity = require("format-quantity"); | ||
<script src="bower_components/format-quantity/index.js"></script> | ||
<script> | ||
console.log(formatQuantity(10.5)); // "10 1/2" | ||
</script> | ||
``` | ||
### Usage | ||
``` | ||
var formatQuantity = require("format-quantity"); // assuming node environment | ||
console.log( formatQuantity(1.5) ); // "1 1/2" | ||
console.log( formatQuantity(2.66) ); // "2 2/3" | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6883
32