@procore/globalization-toolkit 1.15.2 → 1.16.0
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/.eslintrc.js +1 -0
- package/dist/dateTimes/DateTime.types.d.ts +12 -0
- package/dist/dateTimes/DateTime.types.js +5 -1
- package/dist/dateTimes/DateTime.types.js.map +1 -1
- package/dist/dateTimes/DateTimeFormatter.d.ts +3 -1
- package/dist/dateTimes/DateTimeFormatter.js +32 -1
- package/dist/dateTimes/DateTimeFormatter.js.map +1 -1
- package/dist/dateTimes/DateTimeUtils.js +2 -0
- package/dist/dateTimes/DateTimeUtils.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/numbers/CurrencyFormatter.js +8 -6
- package/dist/numbers/CurrencyFormatter.js.map +1 -1
- package/dist/numbers/CurrencyUtils.js +1 -4
- package/dist/numbers/CurrencyUtils.js.map +1 -1
- package/dist/numbers/NumberFormatter.d.ts +1 -1
- package/dist/numbers/NumberFormatter.js +8 -6
- package/dist/numbers/NumberFormatter.js.map +1 -1
- package/dist/numbers/NumberFormatter.test.constants.d.ts +2 -0
- package/dist/numbers/NumberFormatter.test.constants.js +6057 -0
- package/dist/numbers/NumberFormatter.test.constants.js.map +1 -0
- package/dist/numbers/NumberUtils.js +6 -8
- package/dist/numbers/NumberUtils.js.map +1 -1
- package/dist/test/TestBuilder.d.ts +26 -0
- package/dist/test/TestBuilder.js +20 -0
- package/dist/test/TestBuilder.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/docs/assets/highlight.css +6 -6
- package/docs/assets/main.js +56 -52
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +23 -0
- package/docs/classes/CurrencyFormatter.html +7 -7
- package/docs/classes/DateTimeFormatter.html +6 -6
- package/docs/classes/NumberFormatter.html +8 -8
- package/docs/functions/formatCurrency.html +6 -1
- package/docs/functions/formatCurrencyToParts.html +6 -1
- package/docs/functions/formatDateTime.html +6 -1
- package/docs/functions/formatDateTimeToParts.html +6 -1
- package/docs/functions/formatNumber.html +6 -1
- package/docs/functions/formatNumberToParts.html +6 -1
- package/docs/functions/getCurrencySeparators.html +6 -1
- package/docs/functions/getDatePartsWithPlaceholders.html +129 -0
- package/docs/functions/getDatePlaceholder.html +129 -0
- package/docs/functions/getNumberSeparators.html +6 -1
- package/docs/functions/getStartDayOfTheWeek.html +6 -1
- package/docs/functions/parseCurrency.html +6 -1
- package/docs/functions/parseNumber.html +6 -1
- package/docs/index.html +30 -25
- package/docs/interfaces/CurrencyOptions.html +7 -7
- package/docs/interfaces/DateTimeOptionsBasic.html +20 -6
- package/docs/interfaces/DateTimeOptionsComponentsAll.html +28 -12
- package/docs/interfaces/DateTimeOptionsComponentsHourMinute.html +28 -12
- package/docs/interfaces/DateTimeOptionsComponentsHourMinuteSecond.html +28 -12
- package/docs/interfaces/DateTimeOptionsComponentsMonthDay.html +28 -12
- package/docs/interfaces/DateTimeOptionsComponentsWeekdayYearMonthDay.html +28 -12
- package/docs/interfaces/DateTimeOptionsComponentsYearMonth.html +28 -12
- package/docs/interfaces/DateTimeOptionsComponentsYearMonthDay.html +28 -12
- package/docs/interfaces/DateTimeOptionsStyle.html +28 -12
- package/docs/interfaces/NumberOptions.html +5 -5
- package/docs/modules.html +10 -0
- package/docs/types/CurrencyDisplay.html +7 -2
- package/docs/types/CurrencySign.html +7 -2
- package/docs/types/DateLabelOptions.html +119 -0
- package/docs/types/DateStyle.html +7 -2
- package/docs/types/DateTimeFormatPart.html +6 -1
- package/docs/types/DateTimeOptions.html +6 -1
- package/docs/types/DateTimeStyle.html +7 -2
- package/docs/types/Day.html +7 -2
- package/docs/types/FormatterOptions.html +6 -1
- package/docs/types/Hour.html +7 -2
- package/docs/types/Locale.html +6 -1
- package/docs/types/Minute.html +7 -2
- package/docs/types/Month.html +7 -2
- package/docs/types/NumberFormatPart.html +6 -1
- package/docs/types/NumericTwoDigit.html +7 -2
- package/docs/types/Percent.html +7 -2
- package/docs/types/Second.html +7 -2
- package/docs/types/Separators.html +6 -1
- package/docs/types/TimeStyle.html +7 -2
- package/docs/types/TimeZoneName.html +111 -0
- package/docs/types/Weekday.html +7 -2
- package/docs/types/Year.html +7 -2
- package/docs/variables/CurrencyDisplay-1.html +7 -2
- package/docs/variables/CurrencySign-1.html +7 -2
- package/docs/variables/DateStyle-1.html +7 -2
- package/docs/variables/DateTimeStyle-1.html +7 -2
- package/docs/variables/Day-1.html +7 -2
- package/docs/variables/Hour-1.html +7 -2
- package/docs/variables/Minute-1.html +7 -2
- package/docs/variables/Month-1.html +7 -2
- package/docs/variables/NumericTwoDigit-1.html +7 -2
- package/docs/variables/Percent-1.html +7 -2
- package/docs/variables/Second-1.html +7 -2
- package/docs/variables/TimeStyle-1.html +7 -2
- package/docs/variables/TimeZoneName-1.html +118 -0
- package/docs/variables/Weekday-1.html +7 -2
- package/docs/variables/Year-1.html +7 -2
- package/package.json +7 -7
- package/tsconfig.json +2 -2
package/docs/index.html
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<p><a href="https://procoretech.slack.com/archives/C037J98SPHD"><img src="https://img.shields.io/badge/Maintainer-team--global--by--design-orange" alt="Maintainer"></a>
|
|
21
21
|
<a href="https://circleci.com/gh/procore/globalization-toolkit/tree/main"><img src="https://circleci.com/gh/procore/globalization-toolkit/tree/main.svg?style=shield&circle-token=2f3787c62ef88e345956761b9d6e243f043a08a7" alt="CircleCI"></a>
|
|
22
22
|
<a href="https://www.npmjs.com/package/@procore/globalization-toolkit"><img src="https://img.shields.io/badge/NPM-%40procore%2Fglobalization--toolkit-blue" alt="NPM"></a></p>
|
|
23
|
-
<p>Before implementing the Globalization Toolkit (GTK), please review the <a href="https://lucid.app/lucidchart/47c65380-9d87-409a-a15e-77c668e4c474/edit?invitationId=inv_abb5b5f8-3d6f-499f-920d-6dc6b7c9734c&
|
|
23
|
+
<p>Before implementing the Globalization Toolkit (GTK), please review the <a href="https://lucid.app/lucidchart/47c65380-9d87-409a-a15e-77c668e4c474/edit?invitationId=inv_abb5b5f8-3d6f-499f-920d-6dc6b7c9734c&page=0_0#">Globalization Toolkit Adoption Diagram</a> to determine the best implementation strategy for you. Continue reading for instructions on direct usage of the GTK. </p>
|
|
24
24
|
|
|
25
25
|
<a href="#engineering-documentation" id="engineering-documentation" style="color: inherit; text-decoration: none;">
|
|
26
26
|
<h2><a href="https://procore.github.io/globalization-toolkit/">Engineering Documentation</a></h2>
|
|
@@ -37,10 +37,10 @@ Further reading on the GTK:</p>
|
|
|
37
37
|
<h2>Install</h2>
|
|
38
38
|
</a>
|
|
39
39
|
<p>NPM</p>
|
|
40
|
-
<pre><code class="language-sh"><span class="hl-0">$ npm i
|
|
40
|
+
<pre><code class="language-sh"><span class="hl-0">$ </span><span class="hl-1">npm</span><span class="hl-0"> </span><span class="hl-1">i</span><span class="hl-0"> </span><span class="hl-1">--save</span><span class="hl-0"> </span><span class="hl-1">@procore/globalization-toolkit</span>
|
|
41
41
|
</code></pre>
|
|
42
42
|
<p>YARN</p>
|
|
43
|
-
<pre><code class="language-sh"><span class="hl-0">$ yarn add
|
|
43
|
+
<pre><code class="language-sh"><span class="hl-0">$ </span><span class="hl-1">yarn</span><span class="hl-0"> </span><span class="hl-1">add</span><span class="hl-0"> </span><span class="hl-1">@procore/globalization-toolkit</span>
|
|
44
44
|
</code></pre>
|
|
45
45
|
|
|
46
46
|
<a href="#usage" id="usage" style="color: inherit; text-decoration: none;">
|
|
@@ -75,19 +75,19 @@ Further reading on the GTK:</p>
|
|
|
75
75
|
<a href="#formatnumber-amp-formatnumbertoparts" id="formatnumber-amp-formatnumbertoparts" style="color: inherit; text-decoration: none;">
|
|
76
76
|
<h4><a href="https://procore.github.io/globalization-toolkit/classes/NumberFormatter.html#formatNumber">formatNumber()</a> & <a href="https://procore.github.io/globalization-toolkit/classes/NumberFormatter.html#formatNumberToParts">formatNumberToParts()</a></h4>
|
|
77
77
|
</a>
|
|
78
|
-
<pre><code class="language-ts"><span class="hl-
|
|
78
|
+
<pre><code class="language-ts"><span class="hl-2">import</span><span class="hl-0"> { </span><span class="hl-3">NumberFormatter</span><span class="hl-0"> } </span><span class="hl-2">from</span><span class="hl-0"> </span><span class="hl-1">'@procore/globalization-toolkit'</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-6">1234</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">numberOptions</span><span class="hl-0"> = { </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">"en-US"</span><span class="hl-0">, </span><span class="hl-3">minimumFractionDigits:</span><span class="hl-0"> </span><span class="hl-6">3</span><span class="hl-0"> };</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">NumberFormatter</span><span class="hl-0">(</span><span class="hl-3">numberOptions</span><span class="hl-0">);</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">formatNumber</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">)) </span><span class="hl-8">// expected output: '1,234.000'</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">formatNumberToParts</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">))</span><br/><span class="hl-0"> </span><span class="hl-8">/**</span><br/><span class="hl-8"> * expected output is an array of objects representing the parts of the formatted number:</span><br/><span class="hl-8"> * [</span><br/><span class="hl-8"> * { type: "integer", value: "1", },</span><br/><span class="hl-8"> * { type: "group", value: ",", },</span><br/><span class="hl-8"> * { type: "integer", value: "234", },</span><br/><span class="hl-8"> * { type: "decimal", value: ".", },</span><br/><span class="hl-8"> * { type: "fraction", value: "000", },</span><br/><span class="hl-8"> * ];</span><br/><span class="hl-8"> */</span>
|
|
79
79
|
</code></pre>
|
|
80
80
|
|
|
81
81
|
<a href="#parsenumber" id="parsenumber" style="color: inherit; text-decoration: none;">
|
|
82
82
|
<h4><a href="https://procore.github.io/globalization-toolkit/classes/NumberFormatter.html#parseNumber">parseNumber()</a></h4>
|
|
83
83
|
</a>
|
|
84
|
-
<pre><code class="language-ts"><span class="hl-
|
|
84
|
+
<pre><code class="language-ts"><span class="hl-2">import</span><span class="hl-0"> { </span><span class="hl-3">NumberFormatter</span><span class="hl-0"> } </span><span class="hl-2">from</span><span class="hl-0"> </span><span class="hl-1">'@procore/globalization-toolkit'</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-1">"123 456 789,12"</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">numberOptions</span><span class="hl-0"> = { </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">"fr-FR"</span><span class="hl-0"> };</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">NumberFormatter</span><span class="hl-0">(</span><span class="hl-3">numberOptions</span><span class="hl-0">);</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">parseNumber</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">)); </span><span class="hl-8">// expected output: '123456789.12'</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">parseNumber</span><span class="hl-0">(</span><span class="hl-1">"Abcd"</span><span class="hl-0">)); </span><span class="hl-8">// expected output: NaN</span>
|
|
85
85
|
</code></pre>
|
|
86
86
|
|
|
87
87
|
<a href="#getseparators" id="getseparators" style="color: inherit; text-decoration: none;">
|
|
88
88
|
<h4><a href="https://procore.github.io/globalization-toolkit/classes/NumberFormatter.html#getNumberSeparators">getSeparators()</a></h4>
|
|
89
89
|
</a>
|
|
90
|
-
<pre><code class="language-ts"><span class="hl-
|
|
90
|
+
<pre><code class="language-ts"><span class="hl-2">import</span><span class="hl-0"> { </span><span class="hl-3">NumberFormatter</span><span class="hl-0"> } </span><span class="hl-2">from</span><span class="hl-0"> </span><span class="hl-1">'@procore/globalization-toolkit'</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">germanNumberOptions</span><span class="hl-0"> = { </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">"de-DE"</span><span class="hl-0"> };</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">germanFormatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">NumberFormatter</span><span class="hl-0">(</span><span class="hl-3">germanNumberOptions</span><span class="hl-0">);</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">germanFormatter</span><span class="hl-0">.</span><span class="hl-7">getSeparators</span><span class="hl-0">()); </span><span class="hl-8">// expected output: { decimal: ",", group: "." }</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">usNumberOptions</span><span class="hl-0"> = { </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">'en-US'</span><span class="hl-0"> };</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">NumberFormatter</span><span class="hl-0">(</span><span class="hl-3">usNumberOptions</span><span class="hl-0">);</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">getSeparators</span><span class="hl-0">()); </span><span class="hl-8">// expected output: { decimal: ".", group: "," }</span>
|
|
91
91
|
</code></pre>
|
|
92
92
|
|
|
93
93
|
<a href="#numberformatter-functions" id="numberformatter-functions" style="color: inherit; text-decoration: none;">
|
|
@@ -101,7 +101,7 @@ Further reading on the GTK:</p>
|
|
|
101
101
|
<li><a href="https://procore.github.io/globalization-toolkit/functions/getNumberSeparators.html">getNumberSeparators</a></li>
|
|
102
102
|
</ul>
|
|
103
103
|
<p>The example below shows usage of the stand alone function: <code>formatNumber()</code>.</p>
|
|
104
|
-
<pre><code class="language-ts"><span class="hl-
|
|
104
|
+
<pre><code class="language-ts"><span class="hl-2">import</span><span class="hl-0"> { </span><span class="hl-3">formatNumber</span><span class="hl-0"> } </span><span class="hl-2">from</span><span class="hl-0"> </span><span class="hl-1">'@procore/globalization-toolkit'</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-6">1234</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">numberOptions</span><span class="hl-0"> = { </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">"en-US"</span><span class="hl-0">, </span><span class="hl-3">minimumFractionDigits:</span><span class="hl-0"> </span><span class="hl-6">3</span><span class="hl-0"> };</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-7">formatNumber</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">, </span><span class="hl-3">numberOptions</span><span class="hl-0">)) </span><span class="hl-8">// expected output: '1,234.000'</span>
|
|
105
105
|
</code></pre>
|
|
106
106
|
|
|
107
107
|
<a href="#currencyformatter-class" id="currencyformatter-class" style="color: inherit; text-decoration: none;">
|
|
@@ -125,22 +125,22 @@ Further reading on the GTK:</p>
|
|
|
125
125
|
</ul>
|
|
126
126
|
<p>Below code blocks display usage of the CurrencyFormatter class and available functions. </p>
|
|
127
127
|
<p><a href="https://procore.github.io/globalization-toolkit/classes/CurrencyFormatter.html#formatCurrency">formatCurrency(value: number)</a></p>
|
|
128
|
-
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-6">1234</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">currencyOptions</span><span class="hl-0"> = { </span><span class="hl-
|
|
128
|
+
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-6">1234</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">currencyOptions</span><span class="hl-0"> = { </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">"en-US"</span><span class="hl-0">, </span><span class="hl-3">currencyIsoCode:</span><span class="hl-0"> </span><span class="hl-1">"USD"</span><span class="hl-0"> };</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">CurrencyFormatter</span><span class="hl-0">(</span><span class="hl-3">currencyOptions</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">formatCurrency</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">)) </span><span class="hl-8">// expected outcome: '$1,234.00'</span>
|
|
129
129
|
</code></pre>
|
|
130
130
|
<p>Usage with currencyDisplay option</p>
|
|
131
|
-
<pre><code class="language-ts"><span class="hl-
|
|
131
|
+
<pre><code class="language-ts"><span class="hl-2">import</span><span class="hl-0"> { </span><span class="hl-3">CurrencyFormatter</span><span class="hl-0"> } </span><span class="hl-2">from</span><span class="hl-0"> </span><span class="hl-1">'@procore/globalization-toolkit'</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-6">1234.567</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">currencyOptions</span><span class="hl-0">: </span><span class="hl-9">CurrencyOptions</span><span class="hl-0"> = {</span><br/><span class="hl-0"> </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">"de-DE"</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">currencyIsoCode:</span><span class="hl-0"> </span><span class="hl-1">"USD"</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">currencyDisplay:</span><span class="hl-0"> </span><span class="hl-1">"name"</span><span class="hl-0">,</span><br/><span class="hl-0"> };</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">CurrencyFormatter</span><span class="hl-0">(</span><span class="hl-3">currencyOptions</span><span class="hl-0">);</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">formatCurrency</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">)); </span><span class="hl-8">// expected outcome: '1.234,57 US-Dollar'</span>
|
|
132
132
|
</code></pre>
|
|
133
133
|
<p>Usage with minimumFractionDigits and currencyDisplay</p>
|
|
134
|
-
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-6">1234.567</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">currencyOptions</span><span class="hl-0"> = {</span><br/><span class="hl-0"> </span><span class="hl-
|
|
134
|
+
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-6">1234.567</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">currencyOptions</span><span class="hl-0"> = {</span><br/><span class="hl-0"> </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">"ja-JP"</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">minimumFractionDigits:</span><span class="hl-0"> </span><span class="hl-6">2</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">currencyIsoCode:</span><span class="hl-0"> </span><span class="hl-1">"JPY"</span><span class="hl-0">,</span><br/><span class="hl-0">};</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">CurrencyFormatter</span><span class="hl-0">(</span><span class="hl-3">currencyOptions</span><span class="hl-0">);</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">formatCurrency</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">)); </span><span class="hl-8">// expected outcome: '¥1,234.57'</span>
|
|
135
135
|
</code></pre>
|
|
136
136
|
<p><a href="https://procore.github.io/globalization-toolkit/classes/CurrencyFormatter.html#formatCurrencyToParts">formatCurrencyToParts()</a></p>
|
|
137
|
-
<pre><code class="language-ts"><span class="hl-
|
|
137
|
+
<pre><code class="language-ts"><span class="hl-2">import</span><span class="hl-0"> { </span><span class="hl-3">CurrencyFormatter</span><span class="hl-0"> } </span><span class="hl-2">from</span><span class="hl-0"> </span><span class="hl-1">'@procore/globalization-toolkit'</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = -</span><span class="hl-6">1234.56</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">currencyOptions</span><span class="hl-0">: </span><span class="hl-9">CurrencyOptions</span><span class="hl-0"> = {</span><br/><span class="hl-0"> </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">"en-US"</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">currencyIsoCode:</span><span class="hl-0"> </span><span class="hl-1">"CAD"</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">currencySign:</span><span class="hl-0"> </span><span class="hl-1">"accounting"</span><span class="hl-0">,</span><br/><span class="hl-0">};</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">CurrencyFormatter</span><span class="hl-0">(</span><span class="hl-3">currencyOptions</span><span class="hl-0">);</span><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">formatCurrencyToParts</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">));</span><br/><span class="hl-0"> </span><span class="hl-8">/** expected output:</span><br/><span class="hl-8"> * [</span><br/><span class="hl-8"> * { type: "literal", value: "(", },</span><br/><span class="hl-8"> * { type: "currency", value: "CA$", },</span><br/><span class="hl-8"> * { type: "integer", value: "1", },</span><br/><span class="hl-8"> * { type: "group", value: ",", },</span><br/><span class="hl-8"> * { type: "integer", value: "234", },</span><br/><span class="hl-8"> * { type: "decimal", value: ".", },</span><br/><span class="hl-8"> * { type: "fraction", value: "56", },</span><br/><span class="hl-8"> * { type: "literal", value: ")", },</span><br/><span class="hl-8"> * ]</span><br/><span class="hl-8"> **/</span>
|
|
138
138
|
</code></pre>
|
|
139
139
|
<p><a href="https://procore.github.io/globalization-toolkit/classes/CurrencyFormatter.html#parseCurrency">parseCurrency(value: string)</a></p>
|
|
140
|
-
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-
|
|
140
|
+
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-1">"(1 234 567,56 €)"</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">currencyOptions</span><span class="hl-0">: </span><span class="hl-9">CurrencyOptions</span><span class="hl-0"> = {</span><br/><span class="hl-0"> </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">"fr-FR"</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">currencyIsoCode:</span><span class="hl-0"> </span><span class="hl-1">"EUR"</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">currencySign:</span><span class="hl-0"> </span><span class="hl-1">"accounting"</span><span class="hl-0">,</span><br/><span class="hl-0">};</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">CurrencyFormatter</span><span class="hl-0">(</span><span class="hl-3">currencyOptions</span><span class="hl-0">);</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">parseCurrency</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">)); </span><span class="hl-8">// expected outcome: -1234567.56</span>
|
|
141
141
|
</code></pre>
|
|
142
142
|
<p><a href="https://procore.github.io/globalization-toolkit/classes/CurrencyFormatter.html#getCurrencySeparators">getCurrencySeparators</a></p>
|
|
143
|
-
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">currencyOptions</span><span class="hl-0"> = { </span><span class="hl-
|
|
143
|
+
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">currencyOptions</span><span class="hl-0"> = { </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">"de-DE"</span><span class="hl-0">, </span><span class="hl-3">currencyIsoCode:</span><span class="hl-0"> </span><span class="hl-1">"EUR"</span><span class="hl-0"> };</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">CurrencyFormatter</span><span class="hl-0">(</span><span class="hl-3">currencyOptions</span><span class="hl-0">);</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">getCurrencySeparators</span><span class="hl-0">()) </span><span class="hl-8">// expected outcome: { decimal: ",", group: "." }</span>
|
|
144
144
|
</code></pre>
|
|
145
145
|
|
|
146
146
|
<a href="#currencyformatter-functions" id="currencyformatter-functions" style="color: inherit; text-decoration: none;">
|
|
@@ -154,7 +154,7 @@ Further reading on the GTK:</p>
|
|
|
154
154
|
<li><a href="https://procore.github.io/globalization-toolkit/functions/getCurrencySeparators.html">getCurrencySeparators</a></li>
|
|
155
155
|
</ul>
|
|
156
156
|
<p>The example below shows usage of the stand alone function: <code>formatCurrency(value, options)</code>.</p>
|
|
157
|
-
<pre><code class="language-ts"><span class="hl-
|
|
157
|
+
<pre><code class="language-ts"><span class="hl-2">import</span><span class="hl-0"> { </span><span class="hl-3">formatCurrency</span><span class="hl-0">, </span><span class="hl-3">getCurrencySeparators</span><span class="hl-0"> } </span><span class="hl-2">from</span><span class="hl-0"> </span><span class="hl-1">'@procore/globalization-toolkit'</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-6">1234</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">currencyOptions</span><span class="hl-0"> = { </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">'en-US'</span><span class="hl-0">, </span><span class="hl-3">currencyIsoCode:</span><span class="hl-0"> </span><span class="hl-1">'USD'</span><span class="hl-0"> };</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-7">formatCurrency</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">, </span><span class="hl-3">currencyOptions</span><span class="hl-0">)) </span><span class="hl-8">// expected output: '$1,234.00'</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-7">getCurrencySeparators</span><span class="hl-0">(</span><span class="hl-3">currencyOptions</span><span class="hl-0">)) </span><span class="hl-8">// expected output: { decimal: ".", group: "," }</span>
|
|
158
158
|
</code></pre>
|
|
159
159
|
|
|
160
160
|
<a href="#datetimeformatter" id="datetimeformatter" style="color: inherit; text-decoration: none;">
|
|
@@ -185,16 +185,16 @@ Further reading on the GTK:</p>
|
|
|
185
185
|
</li>
|
|
186
186
|
</ol>
|
|
187
187
|
<p>Below code blocks display usage of the DateTimeFormatter class and available functions.<br><a href="https://procore.github.io/globalization-toolkit/classes/DateTimeFormatter.html#formatDateTime">formatDateTime(value: Date)</a><br>SIMPLE OPTIONS</p>
|
|
188
|
-
<pre><code class="language-ts"><span class="hl-
|
|
188
|
+
<pre><code class="language-ts"><span class="hl-2">import</span><span class="hl-0"> { </span><span class="hl-3">DateTimeFormatter</span><span class="hl-0"> } </span><span class="hl-2">from</span><span class="hl-0"> </span><span class="hl-1">'@procore/globalization-toolkit'</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">Date</span><span class="hl-0">(</span><span class="hl-6">1445419756738</span><span class="hl-0">);</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">dateTimeOptions</span><span class="hl-0"> = {</span><br/><span class="hl-0"> </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">'en-US'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">timeZone:</span><span class="hl-0"> </span><span class="hl-1">'UTC'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">dateStyle:</span><span class="hl-0"> </span><span class="hl-1">'full'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">timeStyle:</span><span class="hl-0"> </span><span class="hl-1">'long'</span><span class="hl-0">,</span><br/><span class="hl-0">};</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">DateTimeFormatter</span><span class="hl-0">(</span><span class="hl-3">dateTimeOptions</span><span class="hl-0">);</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">formatDateTime</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">))</span><br/><span class="hl-8">// expected output: Wednesday, October 21, 2015 at 9:29:16 AM UTC</span>
|
|
189
189
|
</code></pre>
|
|
190
190
|
<p>COMPLEX OPTIONS</p>
|
|
191
|
-
<pre><code class="language-js"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">Date</span><span class="hl-0">(</span><span class="hl-
|
|
191
|
+
<pre><code class="language-js"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">Date</span><span class="hl-0">(</span><span class="hl-3">Date</span><span class="hl-0">.</span><span class="hl-7">UTC</span><span class="hl-0">(</span><span class="hl-6">1885</span><span class="hl-0">, </span><span class="hl-6">8</span><span class="hl-0">, </span><span class="hl-6">1</span><span class="hl-0">, </span><span class="hl-6">12</span><span class="hl-0">, </span><span class="hl-6">0</span><span class="hl-0">, </span><span class="hl-6">16</span><span class="hl-0">, </span><span class="hl-6">738</span><span class="hl-0">));</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">dateTimeOptions</span><span class="hl-0"> = {</span><br/><span class="hl-0"> </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">'en-US'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">timeZone:</span><span class="hl-0"> </span><span class="hl-1">'UTC'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">weekday:</span><span class="hl-0"> </span><span class="hl-1">'long'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">year:</span><span class="hl-0"> </span><span class="hl-1">'numeric'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">month:</span><span class="hl-0"> </span><span class="hl-1">'2-digit'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">day:</span><span class="hl-0"> </span><span class="hl-1">'2-digit'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">hour:</span><span class="hl-0"> </span><span class="hl-1">'numeric'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">minute:</span><span class="hl-0"> </span><span class="hl-1">'2-digit'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">second:</span><span class="hl-0"> </span><span class="hl-1">'2-digit'</span><span class="hl-0">,</span><br/><span class="hl-0">};</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">DateTimeFormatter</span><span class="hl-0">(</span><span class="hl-3">dateTimeOptions</span><span class="hl-0">);</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">formatDateTime</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">))</span><br/><span class="hl-8">// expected output: "Tuesday, 09/01/1885, 12:00:16 PM";</span>
|
|
192
192
|
</code></pre>
|
|
193
193
|
<p><a href="https://procore.github.io/globalization-toolkit/classes/DateTimeFormatter.html#formatDateTimeToParts">formatDateTimeToParts(value: Date)</a></p>
|
|
194
|
-
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">Date</span><span class="hl-0">(</span><span class="hl-
|
|
194
|
+
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">Date</span><span class="hl-0">(</span><span class="hl-3">Date</span><span class="hl-0">.</span><span class="hl-7">UTC</span><span class="hl-0">(</span><span class="hl-6">1955</span><span class="hl-0">, </span><span class="hl-6">10</span><span class="hl-0">, </span><span class="hl-6">5</span><span class="hl-0">, </span><span class="hl-6">6</span><span class="hl-0">, </span><span class="hl-6">0</span><span class="hl-0">, </span><span class="hl-6">16</span><span class="hl-0">, </span><span class="hl-6">738</span><span class="hl-0">));</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">dateTimeOptions</span><span class="hl-0"> = {</span><br/><span class="hl-0"> </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">"en-GB"</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">timeZone:</span><span class="hl-0"> </span><span class="hl-1">"UTC"</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">dateStyle:</span><span class="hl-0"> </span><span class="hl-3">DateStyle</span><span class="hl-0">.</span><span class="hl-5">FULL</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-3">timeStyle:</span><span class="hl-0"> </span><span class="hl-3">TimeStyle</span><span class="hl-0">.</span><span class="hl-5">SHORT</span><span class="hl-0">,</span><br/><span class="hl-0">};</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">DateTimeFormatter</span><span class="hl-0">(</span><span class="hl-3">dateTimeOptions</span><span class="hl-0">);</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">formatDateTime</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">))</span><br/><span class="hl-0"> </span><span class="hl-8">/** expected output: </span><br/><span class="hl-8"> * [ { type: "weekday", value: "Saturday", },</span><br/><span class="hl-8"> * { type: "literal", value: ", ", },</span><br/><span class="hl-8"> * { type: "day", value: "5", },</span><br/><span class="hl-8"> * { type: "literal", value: " ", },</span><br/><span class="hl-8"> * { type: "month", value: "November", },</span><br/><span class="hl-8"> * { type: "literal", value: " ", },</span><br/><span class="hl-8"> * { type: "year", value: "1955", },</span><br/><span class="hl-8"> * { type: "literal", value: " at ",},</span><br/><span class="hl-8"> * { type: "hour", value: "06",},</span><br/><span class="hl-8"> * { type: "literal", value: ":",},</span><br/><span class="hl-8"> * { type: "minute", value: "00",}, ];</span><br/><span class="hl-8"> **/</span>
|
|
195
195
|
</code></pre>
|
|
196
196
|
<p><a href="https://procore.github.io/globalization-toolkit/classes/DateTimeFormatter.html#getStartDayOfTheWeek">getStartDayOfTheWeek()</a><br>This function returns an index value representing the start day of the week on the locale's calendar { Sunday: 0, Monday: 1 ...etc }</p>
|
|
197
|
-
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">dateTimeOptions</span><span class="hl-0"> = { </span><span class="hl-
|
|
197
|
+
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">dateTimeOptions</span><span class="hl-0"> = { </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">'en-US'</span><span class="hl-0"> };</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">formatter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">DateTimeFormatter</span><span class="hl-0">(</span><span class="hl-3">dateTimeOptions</span><span class="hl-0">);</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-3">formatter</span><span class="hl-0">.</span><span class="hl-7">startDayOfTheWeek</span><span class="hl-0">()); </span><span class="hl-8">// expected output: 0</span>
|
|
198
198
|
</code></pre>
|
|
199
199
|
|
|
200
200
|
<a href="#datetimeformatter-functions" id="datetimeformatter-functions" style="color: inherit; text-decoration: none;">
|
|
@@ -207,7 +207,7 @@ Further reading on the GTK:</p>
|
|
|
207
207
|
<li><a href="https://procore.github.io/globalization-toolkit/functions/getStartDayOfTheWeek.html">getStartDayOfTheWeek(locale: string)</a></li>
|
|
208
208
|
</ul>
|
|
209
209
|
<p>The example below shows usage of the stand alone function: <code>formatDateTime()</code>.</p>
|
|
210
|
-
<pre><code class="language-ts"><span class="hl-
|
|
210
|
+
<pre><code class="language-ts"><span class="hl-2">import</span><span class="hl-0"> { </span><span class="hl-3">formatDateTime</span><span class="hl-0"> } </span><span class="hl-2">from</span><span class="hl-0"> </span><span class="hl-1">'@procore/globalization-toolkit'</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">value</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-7">Date</span><span class="hl-0">(</span><span class="hl-3">Date</span><span class="hl-0">.</span><span class="hl-7">UTC</span><span class="hl-0">(</span><span class="hl-6">1955</span><span class="hl-0">, </span><span class="hl-6">10</span><span class="hl-0">, </span><span class="hl-6">5</span><span class="hl-0">, </span><span class="hl-6">6</span><span class="hl-0">, </span><span class="hl-6">0</span><span class="hl-0">, </span><span class="hl-6">16</span><span class="hl-0">, </span><span class="hl-6">738</span><span class="hl-0">));</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-5">dateTimeOptions</span><span class="hl-0"> = { </span><span class="hl-3">locale:</span><span class="hl-0"> </span><span class="hl-1">"en-US"</span><span class="hl-0">, </span><span class="hl-3">timeZone:</span><span class="hl-0"> </span><span class="hl-1">"UTC"</span><span class="hl-0"> };</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-7">log</span><span class="hl-0">(</span><span class="hl-7">formatDateTime</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">, </span><span class="hl-3">dateTimeOptions</span><span class="hl-0">)) </span><span class="hl-8">// expected output: 11/5/1955</span>
|
|
211
211
|
</code></pre>
|
|
212
212
|
<hr>
|
|
213
213
|
|
|
@@ -215,23 +215,23 @@ Further reading on the GTK:</p>
|
|
|
215
215
|
<h1>Developing</h1>
|
|
216
216
|
</a>
|
|
217
217
|
<p>Install dependencies:</p>
|
|
218
|
-
<pre><code class="language-sh"><span class="hl-0">$ npm install</span>
|
|
218
|
+
<pre><code class="language-sh"><span class="hl-0">$ </span><span class="hl-1">npm</span><span class="hl-0"> </span><span class="hl-1">install</span>
|
|
219
219
|
</code></pre>
|
|
220
220
|
<p>Prepare project:</p>
|
|
221
|
-
<pre><code class="language-sh"><span class="hl-0">$ npm run prepare</span>
|
|
221
|
+
<pre><code class="language-sh"><span class="hl-0">$ </span><span class="hl-1">npm</span><span class="hl-0"> </span><span class="hl-1">run</span><span class="hl-0"> </span><span class="hl-1">prepare</span>
|
|
222
222
|
</code></pre>
|
|
223
223
|
<p>Compile Typescript:</p>
|
|
224
|
-
<pre><code class="language-sh"><span class="hl-0">$ npm run build</span>
|
|
224
|
+
<pre><code class="language-sh"><span class="hl-0">$ </span><span class="hl-1">npm</span><span class="hl-0"> </span><span class="hl-1">run</span><span class="hl-0"> </span><span class="hl-1">build</span>
|
|
225
225
|
</code></pre>
|
|
226
226
|
<p>(Delete build <code>npm run clean</code>)</p>
|
|
227
227
|
|
|
228
228
|
<a href="#testing" id="testing" style="color: inherit; text-decoration: none;">
|
|
229
229
|
<h2>Testing</h2>
|
|
230
230
|
</a>
|
|
231
|
-
<pre><code class="language-sh"><span class="hl-0">$ npm run </span><span class="hl-
|
|
231
|
+
<pre><code class="language-sh"><span class="hl-0">$ </span><span class="hl-1">npm</span><span class="hl-0"> </span><span class="hl-1">run</span><span class="hl-0"> </span><span class="hl-1">test</span>
|
|
232
232
|
</code></pre>
|
|
233
233
|
<p>If adding a new supported export (or removing one in a breaking change), update the snapshot test output and commit the change.</p>
|
|
234
|
-
<pre><code class="language-sh"><span class="hl-0">$ npm run </span><span class="hl-
|
|
234
|
+
<pre><code class="language-sh"><span class="hl-0">$ </span><span class="hl-1">npm</span><span class="hl-0"> </span><span class="hl-1">run</span><span class="hl-0"> </span><span class="hl-1">test</span><span class="hl-0"> </span><span class="hl-1">--</span><span class="hl-0"> </span><span class="hl-1">-u</span>
|
|
235
235
|
</code></pre>
|
|
236
236
|
<p>To check formatting run <code>npm run lint:check</code> and <code>npm run format:check</code>.</p>
|
|
237
237
|
|
|
@@ -251,7 +251,7 @@ and helps to maintain a more easily readable commit history.</p>
|
|
|
251
251
|
</code></pre>
|
|
252
252
|
<p>We use the command line tool <a href="https://github.com/commitizen/cz-cli#using-the-command-line-tool"><code>commitizen</code></a> to help walk you through generating a Conventional Commit.</p>
|
|
253
253
|
<p><strong>To invoke this tool run:</strong></p>
|
|
254
|
-
<pre><code class="language-sh"><span class="hl-0">$ npm run cm</span>
|
|
254
|
+
<pre><code class="language-sh"><span class="hl-0">$ </span><span class="hl-1">npm</span><span class="hl-0"> </span><span class="hl-1">run</span><span class="hl-0"> </span><span class="hl-1">cm</span>
|
|
255
255
|
</code></pre>
|
|
256
256
|
<p>(Optional: <a href="https://github.com/commitizen/cz-cli#optional-running-commitizen-on-git-commit">run commitizen on <code>git commit</code></a>)</p>
|
|
257
257
|
|
|
@@ -346,6 +346,7 @@ and can be found in the <strong>Releases</strong> section of Github.</p>
|
|
|
346
346
|
<li class="tsd-kind-interface"><a href="interfaces/NumberOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>Number<wbr/>Options</a></li>
|
|
347
347
|
<li class="tsd-kind-type-alias"><a href="types/CurrencyDisplay.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-4194304-path"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)" id="icon-4194304-text"></path></svg>Currency<wbr/>Display</a></li>
|
|
348
348
|
<li class="tsd-kind-type-alias"><a href="types/CurrencySign.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Currency<wbr/>Sign</a></li>
|
|
349
|
+
<li class="tsd-kind-type-alias"><a href="types/DateLabelOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Date<wbr/>Label<wbr/>Options</a></li>
|
|
349
350
|
<li class="tsd-kind-type-alias"><a href="types/DateStyle.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Date<wbr/>Style</a></li>
|
|
350
351
|
<li class="tsd-kind-type-alias"><a href="types/DateTimeFormatPart.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Date<wbr/>Time<wbr/>Format<wbr/>Part</a></li>
|
|
351
352
|
<li class="tsd-kind-type-alias"><a href="types/DateTimeOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Date<wbr/>Time<wbr/>Options</a></li>
|
|
@@ -362,6 +363,7 @@ and can be found in the <strong>Releases</strong> section of Github.</p>
|
|
|
362
363
|
<li class="tsd-kind-type-alias"><a href="types/Second.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Second</a></li>
|
|
363
364
|
<li class="tsd-kind-type-alias"><a href="types/Separators.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Separators</a></li>
|
|
364
365
|
<li class="tsd-kind-type-alias"><a href="types/TimeStyle.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Time<wbr/>Style</a></li>
|
|
366
|
+
<li class="tsd-kind-type-alias"><a href="types/TimeZoneName.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Time<wbr/>Zone<wbr/>Name</a></li>
|
|
365
367
|
<li class="tsd-kind-type-alias"><a href="types/Weekday.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Weekday</a></li>
|
|
366
368
|
<li class="tsd-kind-type-alias"><a href="types/Year.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Year</a></li>
|
|
367
369
|
<li class="tsd-kind-variable"><a href="variables/CurrencyDisplay-1.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-32-path"></rect><path d="M11.106 16L8.85 7.24H9.966L11.454 13.192C11.558 13.608 11.646 13.996 11.718 14.356C11.79 14.708 11.842 14.976 11.874 15.16C11.906 14.976 11.954 14.708 12.018 14.356C12.09 13.996 12.178 13.608 12.282 13.192L13.758 7.24H14.85L12.582 16H11.106Z" fill="var(--color-text)" id="icon-32-text"></path></svg>Currency<wbr/>Display</a></li>
|
|
@@ -376,6 +378,7 @@ and can be found in the <strong>Releases</strong> section of Github.</p>
|
|
|
376
378
|
<li class="tsd-kind-variable"><a href="variables/Percent-1.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-32-path"></use><use href="#icon-32-text"></use></svg>Percent</a></li>
|
|
377
379
|
<li class="tsd-kind-variable"><a href="variables/Second-1.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-32-path"></use><use href="#icon-32-text"></use></svg>Second</a></li>
|
|
378
380
|
<li class="tsd-kind-variable"><a href="variables/TimeStyle-1.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-32-path"></use><use href="#icon-32-text"></use></svg>Time<wbr/>Style</a></li>
|
|
381
|
+
<li class="tsd-kind-variable"><a href="variables/TimeZoneName-1.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-32-path"></use><use href="#icon-32-text"></use></svg>Time<wbr/>Zone<wbr/>Name</a></li>
|
|
379
382
|
<li class="tsd-kind-variable"><a href="variables/Weekday-1.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-32-path"></use><use href="#icon-32-text"></use></svg>Weekday</a></li>
|
|
380
383
|
<li class="tsd-kind-variable"><a href="variables/Year-1.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-32-path"></use><use href="#icon-32-text"></use></svg>Year</a></li>
|
|
381
384
|
<li class="tsd-kind-function"><a href="functions/formatCurrency.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-64-path"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)" id="icon-64-text"></path></svg>format<wbr/>Currency</a></li>
|
|
@@ -385,6 +388,8 @@ and can be found in the <strong>Releases</strong> section of Github.</p>
|
|
|
385
388
|
<li class="tsd-kind-function"><a href="functions/formatNumber.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>format<wbr/>Number</a></li>
|
|
386
389
|
<li class="tsd-kind-function"><a href="functions/formatNumberToParts.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>format<wbr/>Number<wbr/>To<wbr/>Parts</a></li>
|
|
387
390
|
<li class="tsd-kind-function"><a href="functions/getCurrencySeparators.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>get<wbr/>Currency<wbr/>Separators</a></li>
|
|
391
|
+
<li class="tsd-kind-function"><a href="functions/getDatePartsWithPlaceholders.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>get<wbr/>Date<wbr/>Parts<wbr/>With<wbr/>Placeholders</a></li>
|
|
392
|
+
<li class="tsd-kind-function"><a href="functions/getDatePlaceholder.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>get<wbr/>Date<wbr/>Placeholder</a></li>
|
|
388
393
|
<li class="tsd-kind-function"><a href="functions/getNumberSeparators.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>get<wbr/>Number<wbr/>Separators</a></li>
|
|
389
394
|
<li class="tsd-kind-function"><a href="functions/getStartDayOfTheWeek.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>get<wbr/>Start<wbr/>Day<wbr/>Of<wbr/>The<wbr/>Week</a></li>
|
|
390
395
|
<li class="tsd-kind-function"><a href="functions/parseCurrency.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>parse<wbr/>Currency</a></li>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<ul class="tsd-hierarchy">
|
|
23
23
|
<li><span class="target">CurrencyOptions</span></li></ul></li></ul></section><aside class="tsd-sources">
|
|
24
24
|
<ul>
|
|
25
|
-
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/
|
|
25
|
+
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/f4af165/src/numbers/Currency.types.ts#L21">numbers/Currency.types.ts:21</a></li></ul></aside>
|
|
26
26
|
<section class="tsd-panel-group tsd-index-group">
|
|
27
27
|
<section class="tsd-panel tsd-index-panel">
|
|
28
28
|
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
@@ -43,35 +43,35 @@
|
|
|
43
43
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>currency<wbr/>Display</span><a href="#currencyDisplay" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none" id="icon-anchor-a"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" id="icon-anchor-b"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" id="icon-anchor-c"></path></svg></a></h3>
|
|
44
44
|
<div class="tsd-signature">currency<wbr/>Display<span class="tsd-signature-symbol">?:</span> <a href="../variables/CurrencyDisplay-1.html" class="tsd-signature-type" data-tsd-kind="Variable">CurrencyDisplay</a></div><aside class="tsd-sources">
|
|
45
45
|
<ul>
|
|
46
|
-
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/
|
|
46
|
+
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/f4af165/src/numbers/Currency.types.ts#L23">numbers/Currency.types.ts:23</a></li></ul></aside></section>
|
|
47
47
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="currencyIsoCode" class="tsd-anchor"></a>
|
|
48
48
|
<h3 class="tsd-anchor-link"><span>currency<wbr/>Iso<wbr/>Code</span><a href="#currencyIsoCode" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
49
49
|
<div class="tsd-signature">currency<wbr/>Iso<wbr/>Code<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
|
|
50
50
|
<ul>
|
|
51
|
-
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/
|
|
51
|
+
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/f4af165/src/numbers/Currency.types.ts#L22">numbers/Currency.types.ts:22</a></li></ul></aside></section>
|
|
52
52
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="currencySign" class="tsd-anchor"></a>
|
|
53
53
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>currency<wbr/>Sign</span><a href="#currencySign" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
54
54
|
<div class="tsd-signature">currency<wbr/>Sign<span class="tsd-signature-symbol">?:</span> <a href="../variables/CurrencySign-1.html" class="tsd-signature-type" data-tsd-kind="Variable">CurrencySign</a></div><aside class="tsd-sources">
|
|
55
55
|
<ul>
|
|
56
|
-
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/
|
|
56
|
+
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/f4af165/src/numbers/Currency.types.ts#L24">numbers/Currency.types.ts:24</a></li></ul></aside></section>
|
|
57
57
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="locale" class="tsd-anchor"></a>
|
|
58
58
|
<h3 class="tsd-anchor-link"><span>locale</span><a href="#locale" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
59
59
|
<div class="tsd-signature">locale<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
|
|
60
60
|
<p>Inherited from NumberOptionsBasic.locale</p>
|
|
61
61
|
<ul>
|
|
62
|
-
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/
|
|
62
|
+
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/f4af165/src/Formatter.types.ts#L4">Formatter.types.ts:4</a></li></ul></aside></section>
|
|
63
63
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="maximumFractionDigits" class="tsd-anchor"></a>
|
|
64
64
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>maximum<wbr/>Fraction<wbr/>Digits</span><a href="#maximumFractionDigits" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
65
65
|
<div class="tsd-signature">maximum<wbr/>Fraction<wbr/>Digits<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources">
|
|
66
66
|
<p>Inherited from NumberOptionsBasic.maximumFractionDigits</p>
|
|
67
67
|
<ul>
|
|
68
|
-
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/
|
|
68
|
+
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/f4af165/src/numbers/Number.types.ts#L5">numbers/Number.types.ts:5</a></li></ul></aside></section>
|
|
69
69
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a id="minimumFractionDigits" class="tsd-anchor"></a>
|
|
70
70
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>minimum<wbr/>Fraction<wbr/>Digits</span><a href="#minimumFractionDigits" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
71
71
|
<div class="tsd-signature">minimum<wbr/>Fraction<wbr/>Digits<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources">
|
|
72
72
|
<p>Inherited from NumberOptionsBasic.minimumFractionDigits</p>
|
|
73
73
|
<ul>
|
|
74
|
-
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/
|
|
74
|
+
<li>Defined in <a href="https://github.com/procore/globalization-toolkit/blob/f4af165/src/numbers/Number.types.ts#L4">numbers/Number.types.ts:4</a></li></ul></aside></section></section></div>
|
|
75
75
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
76
76
|
<div class="tsd-navigation settings">
|
|
77
77
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|