@glister/currency-utils 1.0.1 → 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.
Files changed (2) hide show
  1. package/README.md +21 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -56,8 +56,29 @@ setCurrencyConfig({
56
56
  locale: 'en-NG',
57
57
  });
58
58
  ```
59
+ ---
60
+
61
+ ### On the Next.js codebase
62
+
63
+ Call `setCurrencyConfig` inside a client component or provider:
64
+
65
+ ```ts
66
+ 'use client';
67
+
68
+ import { useEffect } from 'react';
69
+ import { setCurrencyConfig } from '@glister/currency-utils';
70
+
71
+ useEffect(() => {
72
+ setCurrencyConfig({ currency: 'NGN', locale: 'en-NG' });
73
+ }, []);
74
+ ```
75
+
76
+ ---
59
77
 
60
78
  After this, **all formatters automatically respect the config**.
79
+ * Note!: NGN & en-NG is just an example which is Nigeria Currency and English.
80
+
81
+ ---
61
82
 
62
83
  ```ts
63
84
  formatCurrency(1000); // ₦1,000.00
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glister/currency-utils",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Lightweight, tree-shakable currency and number formatting utilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",