@narmi/design_system 1.28.0 → 1.29.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 CHANGED
@@ -84,6 +84,7 @@ npm install && npm run build && npm run storybook
84
84
 
85
85
  `npm run` command | Description
86
86
  -------------------- | ---------------------------------------
87
+ `build:jsdoc` | builds jsDoc documentation to `dist/`
87
88
  `build:tokens` | builds all distributions of design tokens to `dist/`
88
89
  `build:components` | builds all components and base stylesheet to `dist/`
89
90
  `build` | builds everytyhing
@@ -0,0 +1,21 @@
1
+ <a name="formatNumber"></a>
2
+
3
+ ## formatNumber(input, style) ⇒ <code>String</code>
4
+ Thin wrapper for `Intl.NumberFormat` with options configured for Narmi applications.
5
+
6
+ **Kind**: global function
7
+ **Returns**: <code>String</code> - formatted string
8
+
9
+ | Param | Type | Default | Description |
10
+ | --- | --- | --- | --- |
11
+ | input | <code>String</code> \| <code>Number</code> | | string or number to format into a number string |
12
+ | style | <code>String</code> | <code>currency</code> | format style (`currency` or `percent`) |
13
+
14
+ **Example**
15
+ ```js
16
+ formatNumber(1234.56, 'currency'); // '$1,234.56'
17
+ formatNumber(34.4, 'currency'); // '$34.40'
18
+ formatNumber(-12, 'currency'); // '-$12'
19
+ formatNumber('3.40', 'percent'); // '3.4%'
20
+ formatNumber(2, 'percent'); // '2%'
21
+ ```