format-quantity 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -67,9 +67,9 @@ Note: `formatQuantity` supports sixteenths, but no vulgar fraction characters ex
67
67
 
68
68
  ### `tolerance`
69
69
 
70
- | Type | Default |
71
- | -------- | ------: |
72
- | `number` | `0.009` |
70
+ | Type | Default |
71
+ | -------- | -------: |
72
+ | `number` | `0.0075` |
73
73
 
74
74
  This option determines how close the decimal portion of a number has to be to the actual quotient of a fraction to be considered a match. For example, consider the fraction 1⁄3: `1 ÷ 3 = 0.3333...` repeating forever. The number `0.333` (333 thousandths) is not equivalent to 1⁄3, but it's very close. So even though `0.333 !== (1 / 3)`, `formatQuantity(0.333)` will return `"1/3"` the same as `formatQuantity(1/3)`.
75
75
 
package/dist/types.d.ts CHANGED
@@ -11,7 +11,7 @@ export interface FormatQuantityOptions {
11
11
  * will return "2/3". The smaller this number, the higher the likelihood that
12
12
  * the function will return a decimal instead of a fraction or mixed number.
13
13
  *
14
- * @default 0.009
14
+ * @default 0.0075
15
15
  */
16
16
  tolerance?: number;
17
17
  /**
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.0",
2
+ "version": "2.0.1",
3
3
  "name": "format-quantity",
4
4
  "author": "Jake Boone <jakeboone02@gmail.com>",
5
5
  "description": "Number formatter for imperial measurements with support for vulgar fractions",
@@ -42,13 +42,13 @@
42
42
  "@babel/core": "^7.19.1",
43
43
  "@babel/preset-env": "^7.19.1",
44
44
  "@babel/preset-typescript": "^7.18.6",
45
- "@types/jest": "^29.0.2",
45
+ "@types/jest": "^29.0.3",
46
46
  "gh-pages": "^4.0.0",
47
47
  "jest": "^29.0.3",
48
48
  "np": "^7.6.2",
49
49
  "prettier": "^2.7.1",
50
50
  "typescript": "^4.8.3",
51
- "vite": "^3.1.0"
51
+ "vite": "^3.1.3"
52
52
  },
53
53
  "packageManager": "yarn@3.2.3",
54
54
  "publishConfig": {