@lacspace/money 1.0.0 → 1.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 +6 -0
- package/package.json +1 -1
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lacspace/money",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
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",
|