@lacspace/money 1.0.0 → 1.0.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.
- package/README.md +18 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -36,6 +36,12 @@ money(1000, "JPY").format("ja-JP"); // "¥1,000"
|
|
|
36
36
|
money(1.5, "BHD").toMinor(); // 1500 (BHD has 3 decimals)
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
> **Note on `Money.parse()`:** parsing is **best-effort** and locale-agnostic. It
|
|
40
|
+
> can misread strings where the thousands and decimal separators are ambiguous —
|
|
41
|
+
> e.g. `"1,234"` is read as `1.234` (a decimal), not `1234`. For untrusted or
|
|
42
|
+
> locale-specific input, prefer constructing from an explicit numeric amount
|
|
43
|
+
> (`Money.of` / `Money.fromMinor`) rather than relying on `parse()`.
|
|
44
|
+
|
|
39
45
|
## Why minor units
|
|
40
46
|
|
|
41
47
|
```ts
|
|
@@ -60,16 +66,22 @@ All operations return a new `Money` — instances are immutable.
|
|
|
60
66
|
|
|
61
67
|
## Licensing
|
|
62
68
|
|
|
63
|
-
Free under the **[Lacspace Free Licence](https://lacspace.com/licenses/lacspace-free-1.0)** —
|
|
69
|
+
Free under the **[Lacspace Free Licence](https://lacspace.com/licenses/lacspace-free-1.0)** — permissive freedoms. Use it in personal and commercial projects at no cost; just keep the notice. See the **[Lacspace Licence Centre](https://lacspace.com/licenses)**.
|
|
70
|
+
|
|
71
|
+
<!-- LACSPACE-DEV-PLATFORM -->
|
|
64
72
|
|
|
65
73
|
---
|
|
66
74
|
|
|
67
|
-
|
|
75
|
+
## The Lacspace Developer Platform
|
|
68
76
|
|
|
69
|
-
|
|
77
|
+
`@lacspace/money` is part of **63 zero-dependency, isomorphic TypeScript packages** — one standard library for the modern web. Explore the ecosystem:
|
|
70
78
|
|
|
71
|
-
|
|
79
|
+
- 📦 **This package, documented** — https://developer.lacspace.com/packages/money
|
|
80
|
+
- 🗂️ **All 63 packages** — https://developer.lacspace.com/packages
|
|
81
|
+
- 🧭 **Developer handbook** — guides & runnable recipes — https://developer.lacspace.com/handbook
|
|
82
|
+
- 🧪 **Live playground** — run any package in your browser — https://developer.lacspace.com/playground
|
|
83
|
+
- 🖥️ **Finished app templates** — https://templates.lacspace.com
|
|
84
|
+
- 🚀 **Scaffold a full app** — `npm create lacspace-app@latest`
|
|
72
85
|
|
|
73
|
-
|
|
86
|
+
Free under the **[Lacspace Free Licence](https://lacspace.com/licenses/lacspace-free-1.0)** — a permissive, free-to-use licence.
|
|
74
87
|
|
|
75
|
-
<div align="center"><sub>Built with care by <a href="https://lacspace.com">Lacspace</a> · Lacspace Free Licence · <a href="https://github.com/lacspace/npm-packages">source</a></sub></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lacspace/money",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Money done right — integer minor units (no floating-point cent bugs), currency-safe arithmetic, remainder-preserving allocation/split, and localized formatting via Intl. Zero-dependency, isomorphic.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
],
|
|
45
45
|
"author": "Lacspace <contact@lacspace.com>",
|
|
46
46
|
"license": "SEE LICENSE IN LICENSE",
|
|
47
|
-
"homepage": "https://lacspace.com/packages",
|
|
47
|
+
"homepage": "https://developer.lacspace.com/packages/money",
|
|
48
48
|
"repository": {
|
|
49
49
|
"type": "git",
|
|
50
50
|
"url": "git+https://github.com/lacspace/npm-packages.git",
|