make-it-rain 1.1.0 → 1.1.2

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.
Files changed (2) hide show
  1. package/README.md +18 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # 💸 make-it-rain 💸
2
- [![Version](https://img.shields.io/badge/version-1.1.0-blue)](https://npmjs.com/package/make-it-rain) [![Node.js](https://img.shields.io/badge/node-%3E%3D12.0-brightgreen)](https://nodejs.org/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
2
+ [![Version](https://img.shields.io/badge/version-1.1.1.1-blue)](https://npmjs.com/package/make-it-rain) [![Node.js](https://img.shields.io/badge/node-%3E%3D12.0-brightgreen)](https://nodejs.org/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
3
3
 
4
4
  ### The Only Money Formatter You'll Ever Need (Probably)
5
5
 
@@ -27,15 +27,27 @@ yarn add make-it-rain
27
27
  ## 🛠️ Usage
28
28
  Initialize this life-changing formatter once, then flex on your ugly numbers forever.
29
29
 
30
+
30
31
  ```js
31
- const makeItRain = require("make-it-rain");
32
+ const makeItRain = require("make-it-rain");
32
33
 
33
- const money = makeItRain("EUR", "."); // Set it and forget it
34
+ const money = makeItRain("EUR", ".", true); // Set it and forget it
34
35
 
35
- console.log(money.makeItPretty(1234567.89)); // €1.234.567,89
36
- console.log(money.makeItPretty(99.99)); // €99,99
37
- console.log(money.makeItPretty(1000000)); // €1.000.000,00
36
+ console.log(money.makeItPretty(1234567.89)); // €1.234.567,89
37
+ money.useWhat(false); // Switch to ISO code mode
38
+ console.log(money.makeItPretty(1234567.89)); // EUR 1.234.567,89
38
39
  ```
40
+
41
+
42
+ | Method | Description |
43
+ |--------|-------------|
44
+ |`makeItRain(currency, separator, useSymbol)` | Initializes the formatter once. Currency = any ISO currency code, separator = `,` or .`,` useSymbol = `true` for symbols (`$`), `false` for codes (`USD`). |
45
+ | `makeItPretty(amount)` | Takes a number and makes it visually acceptable.|
46
+ | `swapMoney(newCurrency)` | Change the currency to something else, because why not? |
47
+ | `useWhat(symbol)` | Toggle between using currency symbols (`$`) or ISO codes (`USD`). |
48
+ | `whatNow()` | Returns the current currency, in case you forgot. |
49
+
50
+
39
51
  ## 🎩 Features (That Should Have Existed in JavaScript Already)
40
52
  - One-time setup: Set currency & separator once, use it everywhere.
41
53
  - Formats numbers beautifully: Because nobody likes reading 1000000.00.
@@ -47,13 +59,6 @@ console.log(money.makeItPretty(1000000)); // €1.000.000,00
47
59
  - Fix your bad financial decisions: Your debt is still your problem.
48
60
  - Magically make you rich: But hey, your numbers will look expensive.
49
61
 
50
- ##
51
-
52
- | Method | Description |
53
- |--------|-------------|
54
- |`makeItRain(currency, separator)` | Initializes the formatter once. Currency = any ISO currency code, separator = `,` or `.` |
55
- | `makeItPretty(amount)` | Takes a number and makes it visually acceptable.|
56
-
57
62
  ## 🏆 Contributing
58
63
  Want to contribute? Cool. Fork it, break it, fix it, and submit a PR.
59
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "make-it-rain",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Because who formats money manually like a peasant?",
5
5
  "main": "index.js",
6
6
  "bin": {