make-it-rain 1.0.3 → 1.1.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 +20 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
# 💸 make-it-rain 💸
|
|
2
|
+
[](https://npmjs.com/package/make-it-rain) [](https://nodejs.org/) [](https://opensource.org/licenses/MIT)
|
|
3
|
+
|
|
2
4
|
### The Only Money Formatter You'll Ever Need (Probably)
|
|
3
5
|
|
|
4
6
|
So, you've finally decided that numbers should look nice? **Wow, groundbreaking.**
|
|
@@ -10,7 +12,6 @@ Because:
|
|
|
10
12
|
✅ You're too lazy to format numbers manually (same).
|
|
11
13
|
✅ You finally realized not everyone uses the same thousands separator.
|
|
12
14
|
✅ You enjoy writing `toLocaleString()` 50 times per project? No? Didn’t think so.
|
|
13
|
-
✅ Now lets you swap between currency symbols (€, $, ¥) or ISO codes (EUR, USD, JPY) because preferences exist.
|
|
14
15
|
|
|
15
16
|
## 📦 Installation
|
|
16
17
|
Oh no, another package to install? **Deal with it.**
|
|
@@ -27,36 +28,36 @@ yarn add make-it-rain
|
|
|
27
28
|
Initialize this life-changing formatter once, then flex on your ugly numbers forever.
|
|
28
29
|
|
|
29
30
|
```js
|
|
30
|
-
const makeItRain = require("make-it-rain");
|
|
31
|
+
const makeItRain = require("make-it-rain");
|
|
31
32
|
|
|
32
|
-
const money = makeItRain("EUR", "."
|
|
33
|
+
const money = makeItRain("EUR", "."); // Set it and forget it
|
|
33
34
|
|
|
34
|
-
console.log(money.makeItPretty(1234567.89)); // €1.234.567,89
|
|
35
|
-
money.
|
|
36
|
-
console.log(money.makeItPretty(
|
|
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
|
|
37
38
|
```
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
| Method | Description |
|
|
42
|
+
|--------|-------------|
|
|
43
|
+
|`makeItRain(currency, separator, useSymbol)` | Initializes the formatter once. Currency = any ISO currency code, separator = `,` or .`,` useSymbol = `true` for symbols (`$`), `false` for codes (`USD`). |
|
|
44
|
+
| `makeItPretty(amount)` | Takes a number and makes it visually acceptable.|
|
|
45
|
+
| `swapMoney(newCurrency)` | Change the currency to something else, because why not? |
|
|
46
|
+
| `useWhat(symbol)` | Toggle between using currency symbols (`$`) or ISO codes (`USD`). |
|
|
47
|
+
| `whatNow()` | Returns the current currency, in case you forgot. |
|
|
48
|
+
|
|
49
|
+
|
|
38
50
|
## 🎩 Features (That Should Have Existed in JavaScript Already)
|
|
39
51
|
- One-time setup: Set currency & separator once, use it everywhere.
|
|
40
52
|
- Formats numbers beautifully: Because nobody likes reading 1000000.00.
|
|
41
53
|
- Handles separators like a champ: Pick , or ., because the world can't agree.
|
|
42
54
|
- Errors when you mess up: Because I'm not letting you pass "lol" as a number.
|
|
43
|
-
- Toggle between currency symbols & ISO codes: Because some people prefer "€" while others need "EUR" for some serious reason.
|
|
44
55
|
|
|
45
56
|
## ❌ What This Won’t Do
|
|
46
57
|
- Convert currency: This isn't a forex exchange, buddy.
|
|
47
58
|
- Fix your bad financial decisions: Your debt is still your problem.
|
|
48
59
|
- Magically make you rich: But hey, your numbers will look expensive.
|
|
49
60
|
|
|
50
|
-
##
|
|
51
|
-
|
|
52
|
-
| Method | Description |
|
|
53
|
-
|--------|-------------|
|
|
54
|
-
|`makeItRain(currency, separator, useSymbol)` | Initializes the formatter once. Currency = any ISO currency code, separator = `,` or .`,` useSymbol = `true` for symbols (`$`), `false` for codes (`USD`). |
|
|
55
|
-
| `makeItPretty(amount)` | Takes a number and makes it visually acceptable.|
|
|
56
|
-
| `swapMoney(newCurrency)` | Change the currency to something else, because why not? |
|
|
57
|
-
| `useWhat(symbol)` | Toggle between using currency symbols (`$`) or ISO codes (`USD`). |
|
|
58
|
-
| `whatNow()` | Returns the current currency, in case you forgot. |
|
|
59
|
-
|
|
60
61
|
## 🏆 Contributing
|
|
61
62
|
Want to contribute? Cool. Fork it, break it, fix it, and submit a PR.
|
|
62
63
|
|
|
@@ -66,4 +67,5 @@ MIT – Because I'm not here to sue you.
|
|
|
66
67
|
## ⭐ Pro Tip
|
|
67
68
|
Use this package and pretend you’re rich. You’re welcome.
|
|
68
69
|
|
|
69
|
-
This README will **ensure** your package is taken *seriously* while also making people question their life choices.
|
|
70
|
+
This README will **ensure** your package is taken *seriously* while also making people question their life choices.
|
|
71
|
+
|