@@ -161,7 +301,7 @@ Obtains a **Calendar** object.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| locale | string | Yes| Valid locale value, for example, **zh-Hans-CN**.|
| type | string | No| Valid calendar type. Currently, the valid types are as follows: buddhist, chinese, coptic, ethiopic, hebrew, gregory, indian, islamic\_civil, islamic\_tbla, islamic\_umalqura, japanese, and persian. If this parameter is left unspecified, the default calendar type of the specified locale is used.|
| type | string | No| Valid calendar type. Currently, the valid types are as follows: **buddhist**, **chinese**, **coptic**, **ethiopic**, **hebrew**, **gregory**, **indian**, **islamic\_civil**, **islamic\_tbla**, **islamic\_umalqura**, **japanese**, and **persian**. If this parameter is left unspecified, the default calendar type of the specified locale is used.|
- Return value
| Type| Description|
...
...
@@ -295,7 +435,7 @@ Obtains the start day of a week for this **Calendar** object.
- Return value
| Type| Description|
| -------- | -------- |
| number | Start day of a week. The value **1** indicates Sunday, and value **7** indicates Saturday.|
| number | Start day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.|
- Example
```
...
...
@@ -315,7 +455,7 @@ Sets the start day of a week for this **Calendar** object.
- Parameters
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | number | No| Start day of a week. The value **1** indicates Sunday, and value **7** indicates Saturday.|
| value | number | No| Start day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.|
- Example
```
...
...
@@ -375,7 +515,7 @@ Obtains the value of the specified field in the **Calendar** object.
- Parameters
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| field | string | Yes| Value of the specified field in the **Calendar** object. Currently, a valid field can be any of the following: era, year, month, week\_of\_year, week\_of\_month, date, day\_of\_year, day\_of\_week, day\_of\_week\_in\_month, hour, hour\_of\_day, minute, second, millisecond, zone\_offset, dst\_offset, year\_woy, dow\_local, extended\_year, julian\_day, milliseconds\_in\_day, is\_leap\_month.|
| field | string | Yes| Value of the specified field in the **Calendar** object. Currently, a valid field can be any of the following: **era**, **year**, **month**, **week\_of\_year**, **week\_of\_month**, **date**, **day\_of\_year**, **day\_of\_week**, **day\_of\_week\_in\_month**, **hour**, **hour\_of\_day**, **minute**, **second**, **millisecond**, **zone\_offset**, **dst\_offset**, **year\_woy**, **dow\_local**, **extended\_year**, **julian\_day**, **milliseconds\_in\_day**, **is\_leap\_month**.|
- Return value
| Type| Description|
...
...
@@ -431,7 +571,7 @@ Checks whether the specified date in this **Calendar** object is a weekend.
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the date is a weekend, and value **false** indicates a weekday.|
| boolean | Returns **true** if the date is a weekend; returns **false** if the date is a weekday.|
- Example
```
...
...
@@ -482,7 +622,7 @@ Checks whether the format of the specified phone number is valid.
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates the phone number format is valid, and value **false** indicates the opposite.|
| boolean | Returns **true** if the phone number format is valid; returns **false** otherwise.|
- Example
```
...
...
@@ -520,21 +660,23 @@ Formats a phone number.
Defines the options for this PhoneNumberFormat object.
| type | string | Yes| Yes| Format type of a phone number. The value can be **E164**, **INTERNATIONAL**, **NATIONAL**, or **RFC3966**.<br>**System capability**: SystemCapability.Global.I18n|
| type | string | Yes| Yes| Format type of a phone number. The value can be **E164**, **INTERNATIONAL**, **NATIONAL**, or **RFC3966**.|
| unit | string | Yes| Yes| Name of the measurement unit, for example, **meter**, **inch**, or **cup**.|
| measureSystem | string | Yes| Yes| Measurement system. The value can be **SI**, **US**, or **UK**.<br>**System capability**: SystemCapability.Global.I18n|
| measureSystem | string | Yes| Yes| Measurement system. The value can be **SI**, **US**, or **UK**.|
## Util<sup>8+</sup>
...
...
@@ -568,12 +710,9 @@ Converts one measurement unit into another and formats the unit based on the spe
```
## IndexUtil<sup>8+</sup>
### getInstance<sup>8+</sup>
## getInstance<sup>8+</sup>
getInstance(): IndexUtil
getInstance(locale?:string): IndexUtil
Creates an **IndexUtil** object.
...
...
@@ -595,6 +734,9 @@ Creates an **IndexUtil** object.
```
## IndexUtil<sup>8+</sup>
### getIndexList<sup>8+</sup>
getIndexList(): Array<string>
...
...
@@ -617,7 +759,7 @@ Obtains the index list for this **locale** object.
### addLocale<sup>8+</sup>
addLocale(locale: string)
addLocale(locale: string): void
Adds the index of the new **locale** object to the index list.
...
...
@@ -679,7 +821,7 @@ Checks whether the input character string is composed of digits.
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the input character is a digit, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is a digit; returns **false** otherwise.|
- Example
```
...
...
@@ -703,7 +845,7 @@ Checks whether the input character is a space.
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the input character is a space, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is a space; returns **false** otherwise.|
- Example
```
...
...
@@ -727,7 +869,7 @@ Checks whether the input character is a white space.
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the input character is a white space, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is a white space; returns **false** otherwise.|
- Example
```
...
...
@@ -751,7 +893,7 @@ Checks whether the input character is of the right to left (RTL) language.
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the input character is of the RTL language, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is of the RTL language; returns **false** otherwise.|
- Example
```
...
...
@@ -775,7 +917,7 @@ Checks whether the input character is an ideographic character.
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the input character is an ideographic character, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is an ideographic character; returns **false** otherwise.|
- Example
```
...
...
@@ -799,7 +941,7 @@ Checks whether the input character is a letter.
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the input character is a letter, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is a letter; returns **false** otherwise.|
- Example
```
...
...
@@ -823,7 +965,7 @@ Checks whether the input character is a lowercase letter.
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the input character is a lowercase letter, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is a lowercase letter; returns **false** otherwise.|
- Example
```
...
...
@@ -847,7 +989,7 @@ Checks whether the input character is an uppercase letter.
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value true indicates that the input character is an uppercase letter, and value false indicates the opposite.|
| boolean | Returns **true** if the input character is an uppercase letter; returns **false** otherwise.|
- Example
```
...
...
@@ -1105,7 +1247,7 @@ Checks whether the position specified by the offset is a text boundary. If **tru
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the position specified by the offset is a text boundary, and value **false** indicates the opposite.|
| boolean | Returns **true** if the position specified by the offset is a text boundary; returns **false** otherwise.|
- Example
```
...
...
@@ -1127,7 +1269,7 @@ Checks whether the 24-hour clock is used.
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the 24-hour clock is used, and value **false** indicates the opposite.|
| boolean | Returns **true** if the 24-hour clock is used; returns **false** otherwise.|
- Example
```
...
...
@@ -1146,12 +1288,12 @@ Sets the 24-hour clock.
- Parameters
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| option | boolean | Yes| Whether to enable the 24-hour clock. The value **true** means to enable the 24-hour clock, and value **false** means the opposite.|
| option | boolean | Yes| Whether to enable the 24-hour clock. The value **true** means to enable the 24-hour clock, and the value **false** means the opposite.|
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the 24-hour clock is enabled, and value **false** indicates the opposite.|
| boolean | Returns **true** if the 24-hour clock is enabled; returns **false** otherwise.|
- Example
```
...
...
@@ -1177,7 +1319,7 @@ Adds a preferred language to the specified position on the preferred language li
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the preferred language is successfully added, and value **false** indicates the opposite.|
| boolean | Returns **true** if the preferred language is successfully added; returns **false** otherwise.|
- Example
```
...
...
@@ -1188,9 +1330,9 @@ Adds a preferred language to the specified position on the preferred language li
```
## i18n.removeDisplayLanguage<sup>8+</sup>
## i18n.removePreferredLanguage<sup>8+</sup>
removeDisplayLanguage(index: number): boolean
removePreferredLanguage(index: number): boolean
Deletes a preferred language from the specified position on the preferred language list.
...
...
@@ -1204,7 +1346,7 @@ Deletes a preferred language from the specified position on the preferred langua
- Return value
| Type| Description|
| -------- | -------- |
| boolean | The value **true** indicates that the preferred language is deleted, and value **false** indicates the opposite.|
| boolean | Returns **true** if the preferred language is deleted; returns **false** otherwise.|
- Example
```
...
...
@@ -1218,14 +1360,14 @@ Deletes a preferred language from the specified position on the preferred langua
| language | string | Yes| No| Language associated with the locale, for example, **zh**.<br>**System capability**: SystemCapability.Global.I18n|
| script | string | Yes| No| Script type of the language, for example, **Hans**.<br>**System capability**: SystemCapability.Global.I18n|
| region | string | Yes| No| Region associated with the locale, for example, **CN**.<br>**System capability**: SystemCapability.Global.I18n|
| baseName | string | Yes| No| Basic key information about the locale, which consists of the language, script, and region, for example, **zh-Hans-CN**.<br>**System capability**: SystemCapability.Global.I18n|
| caseFirst | string | Yes| No| Whether case is taken into account for the locale's collation rules. The value can be **upper**, **lower**, or **false**.<br>**System capability**: SystemCapability.Global.I18n|
| calendar | string | Yes| No| Calendar for the locale. The value can be any of the following: buddhist, chinese, coptic, dangi, ethioaa, ethiopic, gregory, hebrew, indian, islamic, islamic-umalqura, islamic-tbla, islamic-civil, islamic-rgsa, iso8601, japanese, persian, roc, islamicc.<br>**System capability**: SystemCapability.Global.I18n|
| collation | string | Yes| No| Rule for sorting regions. The value can be any of the following: big5han, compat, dict, direct, ducet, eor, gb2312, phonebk, phonetic, pinyin, reformed, searchjl, stroke, trad, unihan, zhuyin.<br>**System capability**: SystemCapability.Global.I18n|
| hourCycle | string | Yes| No| Time system for the locale. The value can be any of the following: h12, h23, h11, and h24.<br>**System capability**: SystemCapability.Global.I18n|
| numberingSystem | string | Yes| No| Numbering system for the locale. The value can be any of the following: adlm, ahom, arab, arabext, bali, beng, bhks, brah, cakm, cham, deva, diak, fullwide, gong, gonm, gujr, guru, hanidec, hmng, hmnp, java, kali, khmr, knda, lana, lanatham, laoo, latn, lepc, limb, mathbold, mathdbl, mathmono, mathsanb, mathsans, mlym, modi, mong, mroo, mtei, mymr, mymrshan, mymrtlng, newa, nkoo, olck, orya, osma, rohg, saur, segment, shrd, sind, sinh, sora, sund, takr, talu, tamldec, telu, thai, tibt, tirh, vaii, wara, wcho.<br>**System capability**: SystemCapability.Global.I18n|
| numeric | boolean | Yes| No| Whether to apply special collation rules for numeric characters.<br>**System capability**: SystemCapability.Global.I18n|
| language | string | Yes| No| Language associated with the locale, for example, **zh**.|
| script | string | Yes| No| Script type of the language, for example, **Hans**.|
| region | string | Yes| No| Region associated with the locale, for example, **CN**.|
| baseName | string | Yes| No| Basic key information about the locale, which consists of the language, script, and region, for example, **zh-Hans-CN**.|
| caseFirst | string | Yes| No| Whether case is taken into account for the locale's collation rules. The value can be **upper**, **lower**, or **false**.|
| calendar | string | Yes| No| Calendar for the locale. The value can be any of the following: **buddhist**, **chinese**, **coptic","dangi**, **ethioaa**, **ethiopic**, **gregory**, **hebrew**, **indian**, **islamic**, **islamic-umalqura**, **islamic-tbla**, **islamic-civil**, **islamic-rgsa**, **iso8601**, **japanese**, **persian**, **roc**, **islamicc**.|
| collation | string | Yes| No| Rule for sorting regions. The value can be any of the following: **big5han**, **compat**, **dict**, **direct**, **ducet**, **eor**, **gb2312**, **phonebk**, **phonetic**, **pinyin**, **reformed**, **searchjl**, **stroke**, **trad**, **unihan**, **zhuyin**.|
| hourCycle | string | Yes| No| Time system for the locale. The value can be any of the following: **h12**, **h23**, **h11**, **h24**.|
| numberingSystem | string | Yes| No| Numbering system for the locale. The value can be any of the following: **adlm**, **ahom**, **arab**, **arabext**, **bali**, **beng**, **bhks**, **brah**, **cakm**, **cham**, **deva**, **diak**, **fullwide**, **gong**, **gonm**, **gujr**, **guru**, **hanidec**, **hmng**, **hmnp**, **java**, **kali**, **khmr**, **knda**, **lana**, **lanatham**, **laoo**, **latn**, **lepc**, **limb**, **mathbold**, **mathdbl**, **mathmono**, **mathsanb**, **mathsans**, **mlym**, **modi**, **mong**, **mroo**, **mtei**, **mymr**, **mymrshan**, **mymrtlng**, **newa**, **nkoo**, **olck**, **orya**, **osma**, **rohg**, **saur**, **segment**, **shrd**, **sind**, **sinh**, **sora**, **sund**, **takr**, **talu**, **tamldec**, **telu**, **thai**, **tibt**, **tirh**, **vaii**, **wara**, **wcho**.|
| numeric | boolean | Yes| No| Whether to apply special collation rules for numeric characters.|
| calendar | string | Yes| Yes| Calendar for the locale. The calue can be any of the following: **buddhist**, **chinese**, **coptic**, **dangi**, **ethioaa**, **ethiopic**, **gregory**, **hebrew**, **indian**, **islamic**, **islamic-umalqura**, **islamic-tbla**, **islamic-civil**, **islamic-rgsa**, **iso8601**, **japanese**, **persian**, **roc**, **islamicc**.|
| collation | string | Yes| Yes| Collation rule. The value can be any of the following: **big5han**, **compat**, **dict**, **direct**, **ducet**, **emoji**, **eor**, **gb2312**, **phonebk**, **phonetic**, **pinyin**, **reformed**, **search**, **searchjl**, **standard**, **stroke**, **trad**, **unihan**, **zhuyin**.|
| hourCycle | string | Yes| Yes| Time system for the locale. The value can be any of the following: **h11**, **h12**, **h23**, **h24**.|
| numberingSystem | string | Yes| Yes| Numbering system for the locale. The value can be any of the following: **adlm**, **ahom**, **arab**, **arabext**, **bali**, **beng**, **bhks**, **brah**, **cakm**, **cham**, **deva**, **diak**, **fullwide**, **gong**, **gonm**, **gujr**, **guru**, **hanidec**, **hmng**, **hmnp**, **java**, **kali**, **khmr**, **knda**, **lana**, **lanatham**, **laoo**, **latn**, **lepc**, **limb**, **mathbold**, **mathdbl**, **mathmono**, **mathsanb**, **mathsans**, **mlym**, **modi**, **mong**, **mroo**, **mtei**, **mymr**, **mymrshan**, **mymrtlng**, **newa**, **nkoo**, **olck**, **orya**, **osma**, **rohg**, **saur**, **segment**, **shrd**, **sind**, **sinh**, **sora**, **sund**, **takr**, **talu**, **tamldec**, **telu**, **thai**, **tibt**, **tirh**, **vaii**, **wara**, **wcho**.|
| numeric | boolean | Yes| Yes| Whether to use the 12-hour clock.|
| caseFirst | string | Yes| Yes| Whether upper case or lower case is sorted first. The value can be **upper**, **lower**, or **false**.|
| locale | string | Yes| No| Locale, for example, **zh-Hans-CN**.<br>**System capability**: SystemCapability.Global.I18n|
| dateStyle | string | Yes| Yes| Date display format. The value can be **long**, **short**, **medium**, or **full**.<br>**System capability**: SystemCapability.Global.I18n|
| timeStyle | string | Yes| Yes| Time display format. The value can be **long**, **short**, **medium**, or **full**.<br>**System capability**: SystemCapability.Global.I18n|
| hourCycle | string | Yes| Yes| Time system for the locale. The value can be any of the following: h11, h12, h23, h24.<br>**System capability**: SystemCapability.Global.I18n|
| timeZone | string | Yes| Yes| Time zone represented by a valid IANA time zone ID.<br>**System capability**: SystemCapability.Global.I18n|
| numberingSystem | string | Yes| Yes| Numbering system for the locale. The value can be any of the following: adlm, ahom, arab, arabext, bali, beng, bhks, brah, cakm, cham, deva, diak, fullwide, gong, gonm, gujr, guru, hanidec, hmng, hmnp, java, kali, khmr, knda, lana, lanatham, laoo, latn, lepc, limb, mathbold, mathdbl, mathmono, mathsanb, mathsans, mlym, modi, mong, mroo, mtei, mymr, mymrshan, mymrtlng, newa, nkoo, olck, orya, osma, rohg, saur, segment, shrd, sind, sinh, sora, sund, takr, talu, tamldec, telu, thai, tibt, tirh, vaii, wara, wcho.<br>**System capability**: SystemCapability.Global.I18n|
| hour12 | boolean | Yes| Yes| Whether to use the 12-hour clock.<br>**System capability**: SystemCapability.Global.I18n|
| weekday | string | Yes| Yes| Workday display format. The value can be **long**, **short**, or **narrow**.<br>**System capability**: SystemCapability.Global.I18n|
| era | string | Yes| Yes| Era display format. The value can be **long**, **short**, or **narrow**.<br>**System capability**: SystemCapability.Global.I18n|
| year | string | Yes| Yes| Year display format. The value can be **numeric** or **2-digit**. <br>**System capability**: SystemCapability.Global.I18n|
| month | string | Yes| Yes| Month display format. The value can be any of the following: numeric, 2-digit, long, short, narrow.<br>**System capability**: SystemCapability.Global.I18n|
| day | string | Yes| Yes| Day display format. The value can be **numeric** or **2-digit**.<br>**System capability**: SystemCapability.Global.I18n|
| hour | string | Yes| Yes| Hour display format. The value can be **numeric** or **2-digit**.<br>**System capability**: SystemCapability.Global.I18n|
| minute | string | Yes| Yes| Minute display format. The value can be **numeric** or **2-digit**.<br>**System capability**: SystemCapability.Global.I18n|
| second | string | Yes| Yes| Seconds display format. The value can be **numeric** or **2-digit**.<br>**System capability**: SystemCapability.Global.I18n|
| timeZoneName | string | Yes| Yes| Localized representation of a time zone name.<br>**System capability**: SystemCapability.Global.I18n|
| dayPeriod | string | Yes| Yes| Time period display format. The value can be **long**, **short**, or **narrow**.<br>**System capability**: SystemCapability.Global.I18n|
| localeMatcher | string | Yes| Yes| Locale matching algorithm. The value can be **lookup** or **best fit**.<br>**System capability**: SystemCapability.Global.I18n|
| formatMatcher | string | Yes| Yes| Format matching algorithm. The value can be **basic** or **best fit**.<br>**System capability**: SystemCapability.Global.I18n|
| locale | string | Yes| No| Locale, for example, **zh-Hans-CN**.|
| dateStyle | string | Yes| Yes| Date display format. The value can be **long**, **short**, **medium**, or **full**.|
| timeStyle | string | Yes| Yes| Time display format. The value can be **long**, **short**, **medium**, or **full**.|
| hourCycle | string | Yes| Yes| Time system for the locale. The value can be any of the following: **h11**, **h12**, **h23**, **h24**.|
| timeZone | string | Yes| Yes| Time zone represented by a valid IANA time zone ID.|
| numberingSystem | string | Yes| Yes| Numbering system for the locale. The value can be any of the following: **adlm**, **ahom**, **arab**, **arabext**, **bali**, **beng**, **bhks**, **brah**, **cakm**, **cham**, **deva**, **diak**, **fullwide**, **gong**, **gonm**, **gujr**, **guru**, **hanidec**, **hmng**, **hmnp**, **java**, **kali**, **khmr**, **knda**, **lana**, **lanatham**, **laoo**, **latn**, **lepc**, **limb**, **mathbold**, **mathdbl**, **mathmono**, **mathsanb**, **mathsans**, **mlym**, **modi**, **mong**, **mroo**, **mtei**, **mymr**, **mymrshan**, **mymrtlng**, **newa**, **nkoo**, **olck**, **orya**, **osma**, **rohg**, **saur**, **segment**, **shrd**, **sind**, **sinh**, **sora**, **sund**, **takr**, **talu**, **tamldec**, **telu**, **thai**, **tibt**, **tirh**, **vaii**, **wara**, **wcho**.|
| hour12 | boolean | Yes| Yes| Whether to use the 12-hour clock.|
| weekday | string | Yes| Yes| Workday display format. The value can be **long**, **short**, or **narrow**.|
| era | string | Yes| Yes| Era display format. The value can be **long**, **short**, or **narrow**.|
| year | string | Yes| Yes| Year display format. The value can be **numeric** or **2-digit**. |
| month | string | Yes| Yes| Month display format. The value can be any of the following: **numeric**, **2-digit**, **long**, **short**, **narrow**.|
| day | string | Yes| Yes| Day display format. The value can be **numeric** or **2-digit**.|
| hour | string | Yes| Yes| Hour display format. The value can be **numeric** or **2-digit**.|
| minute | string | Yes| Yes| Minute display format. The value can be **numeric** or **2-digit**.|
| second | string | Yes| Yes| Seconds display format. The value can be **numeric** or **2-digit**.|
| timeZoneName | string | Yes| Yes| Localized representation of a time zone name.|
| dayPeriod | string | Yes| Yes| Time period display format. The value can be **long**, **short**, or **narrow**.|
| localeMatcher | string | Yes| Yes| Locale matching algorithm. The value can be **lookup** or **best fit**.|
| formatMatcher | string | Yes| Yes| Format matching algorithm. The value can be **basic** or **best fit**.|
| locale | string | Yes| No| Locale, for example, **zh-Hans-CN**.<br>**System capability**: SystemCapability.Global.I18n|
| currency | string | Yes| Yes| Currency unit, for example, **EUR**, **CNY**, or **USD**.<br>**System capability**: SystemCapability.Global.I18n|
| currencySign | string | Yes| Yes| Currency unit symbol. The value can be **symbol**, **narrowSymbol**, **code**, or **name**.<br>**System capability**: SystemCapability.Global.I18n|
| currencyDisplay | string | Yes| Yes| Currency display mode. The value can be **symbol**, **narrowSymbol**, **code**, or **name**.<br>**System capability**: SystemCapability.Global.I18n|
| unit | string | Yes| Yes| Unit name, for example, **meter**, **inch**, or **hectare**.<br>**System capability**: SystemCapability.Global.I18n|
| unitDisplay | string | Yes| Yes| Unit display format. The value can be **long**, **short**, or **medium**.<br>**System capability**: SystemCapability.Global.I18n|
| unitUsage | string | Yes| Yes| Unit usage scenario. The value can be any of the following: default, area-land-agricult, area-land-commercl, area-land-residntl, length-person, length-person-small, length-rainfall, length-road, length-road-small, length-snowfall, length-vehicle, length-visiblty, length-visiblty-small, length-person-informal, length-person-small-informal, length-road-informal, speed-road-travel, speed-wind, temperature-person, temperature-weather, volume-vehicle-fuel.<br>**System capability**: SystemCapability.Global.I18n|
| signDisplay | string | Yes| Yes| Number sign display format. The value can be **auto**, **never**, always**, or **expectZero**.<br>**System capability**: SystemCapability.Global.I18n|
| compactDisplay | string | Yes| Yes| Compact display format. The value can be **long** or **short**.<br>**System capability**: SystemCapability.Global.I18n|
| notation | string | Yes| Yes| Number formatting specification. The value can be **standard**, **scientific**, engineering**, or **compact**.<br>**System capability**: SystemCapability.Global.I18n|
| localeMatcher | string | Yes| Yes| Locale matching algorithm. The value can be **lookup** or **best fit**.<br>**System capability**: SystemCapability.Global.I18n|
| style | string | Yes| Yes| Number display format. The value can be **decimal**, **currency**, **percent**, or **unit**.<br>**System capability**: SystemCapability.Global.I18n|
| numberingSystem | string | Yes| Yes| Numbering system for the locale. The value can be any of the following: adlm, ahom, arab, arabext, bali, beng, bhks, brah, cakm, cham, deva, diak, fullwide, gong, gonm, gujr, guru, hanidec, hmng, hmnp, java, kali, khmr, knda, lana, lanatham, laoo, latn, lepc, limb, mathbold, mathdbl, mathmono, mathsanb, mathsans, mlym, modi, mong, mroo, mtei, mymr, mymrshan, mymrtlng, newa, nkoo, olck, orya, osma, rohg, saur, segment, shrd, sind, sinh, sora, sund, takr, talu, tamldec, telu, thai, tibt, tirh, vaii, wara, wcho.<br>**System capability**: SystemCapability.Global.I18n|
| useGrouping | boolean | Yes| Yes| Whether to use grouping for display.<br>**System capability**: SystemCapability.Global.I18n|
| miniumumIntegerDigits | number | Yes| Yes| Minimum number of digits allowed in the integer part of a number. The value ranges from **1** to **21**.<br>**System capability**: SystemCapability.Global.I18n|
| miniumumFractionDigits | number | Yes| Yes| Minimum number of digits in the fraction part of a number. The value ranges from **1** to **20**.<br>**System capability**: SystemCapability.Global.I18n|
| maxiumumFractionDigits | number | Yes| Yes| Maximum number of digits in the fraction part of a number. The value ranges from **1** to **21**.<br>**System capability**: SystemCapability.Global.I18n|
| miniumumSignificantDigits | number | Yes| Yes| Minimum number of the least significant digits. The value ranges from **1** to **21**.<br>**System capability**: SystemCapability.Global.I18n|
| maxiumumSignificantDigits | number | Yes| Yes| Maximum number of the least significant digits. The value ranges from **1** to **21**.<br>**System capability**: SystemCapability.Global.I18n|
| locale | string | Yes| No| Locale, for example, **zh-Hans-CN**.|
| currency | string | Yes| Yes| Currency unit, for example, **EUR**, **CNY**, or **USD**.|
| currencySign | string | Yes| Yes| Currency unit symbol. The value can be **symbol**, **narrowSymbol**, **code**, or **name**.|
| currencyDisplay | string | Yes| Yes| Currency display mode. The value can be **symbol**, **narrowSymbol**, **code**, or **name**.|
| unit | string | Yes| Yes| Unit name, for example, **meter**, **inch**, or **hectare**.|
| unitDisplay | string | Yes| Yes| Unit display format. The value can be **long**, **short**, or **medium**.|
| unitUsage | string | Yes| Yes| Unit usage scenario. The value can be any of the following: **default**, **area-land-agricult**, **area-land-commercl**, **area-land-residntl**, **length-person**, **length-person-small**, **length-rainfall**, **length-road**, **length-road-small**, **length-snowfall**, **length-vehicle**, **length-visiblty**, **length-visiblty-small**, **length-person-informal**, **length-person-small-informal**, **length-road-informal**, **speed-road-travel**, **speed-wind**, **temperature-person**, **temperature-weather**, **volume-vehicle-fuel**.|
| signDisplay | string | Yes| Yes| Number sign display format. The value can be **auto**, **never**, always**, or **expectZero**.|
| compactDisplay | string | Yes| Yes| Compact display format. The value can be **long** or **short**.|
| notation | string | Yes| Yes| Number formatting specification. The value can be **standard**, **scientific**, engineering**, or **compact**.|
| localeMatcher | string | Yes| Yes| Locale matching algorithm. The value can be **lookup** or **best fit**.|
| style | string | Yes| Yes| Number display format. The value can be **decimal**, **currency**, **percent**, or **unit**.|
| numberingSystem | string | Yes| Yes| Numbering system for the locale. The value can be any of the following: **adlm**, **ahom**, **arab**, **arabext**, **bali**, **beng**, **bhks**, **brah**, **cakm**, **cham**, **deva**, **diak**, **fullwide**, **gong**, **gonm**, **gujr**, **guru**, **hanidec**, **hmng**, **hmnp**, **java**, **kali**, **khmr**, **knda**, **lana**, **lanatham**, **laoo**, **latn**, **lepc**, **limb**, **mathbold**, **mathdbl**, **mathmono**, **mathsanb**, **mathsans**, **mlym**, **modi**, **mong**, **mroo**, **mtei**, **mymr**, **mymrshan**, **mymrtlng**, **newa**, **nkoo**, **olck**, **orya**, **osma**, **rohg**, **saur**, **segment**, **shrd**, **sind**, **sinh**, **sora**, **sund**, **takr**, **talu**, **tamldec**, **telu**, **thai**, **tibt**, **tirh**, **vaii**, **wara**, **wcho**.|
| useGrouping | boolean | Yes| Yes| Whether to use grouping for display.|
| minimumIntegerDigits | number | Yes| Yes| Minimum number of digits allowed in the integer part of a number. The value ranges from **1** to **21**.|
| minimumFractionDigits | number | Yes| Yes| Minimum number of digits in the fraction part of a number. The value ranges from **0** to **20**.|
| maximumFractionDigits | number | Yes| Yes| Maximum number of digits in the fraction part of a number. The value ranges from **1** to **21**.|
| minimumSignificantDigits | number | Yes| Yes| Minimum number of the least significant digits. The value ranges from **1** to **21**.|
| maximumSignificantDigits | number | Yes| Yes| Maximum number of the least significant digits. The value ranges from **1** to **21**.|
| localeMatcher | string | Yes| Yes| Locale matching algorithm. The value can be **lookup** or **best fit**.<br>**System capability**: SystemCapability.Global.I18n|
| usage | string | Yes| Yes| Whether the comparison is for sorting or for searching. The value can be **sort** or **search**.<br>**System capability**: SystemCapability.Global.I18n|
| sensitivity | string | Yes| Yes| Differences in the strings that lead to non-zero return values. The value can be **base**, **accent**, **case**, or **variant**.<br>**System capability**: SystemCapability.Global.I18n|
| ignorePunctuation | boolean | Yes| Yes| Whether punctuation is ignored. The value can be **true** or **false**.<br>**System capability**: SystemCapability.Global.I18n|
| collation | string | Yes| Yes| Rule for sorting regions. The value can be any of the following: big5han, compat, dict, direct, ducet, eor, gb2312, phonebk, phonetic, pinyin, reformed, searchjl, stroke, trad, unihan, zhuyin.<br>**System capability**: SystemCapability.Global.I18n|
| numeric | boolean | Yes| Yes| Whether numeric collation is used. The value can be **true** or **false**.<br>**System capability**: SystemCapability.Global.I18n|
| caseFirst | string | Yes| Yes| Whether upper case or lower case is sorted first. The value can be **upper**, **lower**, or **false**.<br>**System capability**: SystemCapability.Global.I18n|
| localeMatcher | string | Yes| Yes| Locale matching algorithm. The value can be **lookup** or **best fit**.|
| usage | string | Yes| Yes| Whether the comparison is for sorting or for searching. The value can be **sort** or **search**.|
| sensitivity | string | Yes| Yes| Differences in the strings that lead to non-zero return values. The value can be **base**, **accent**, **case**, or **variant**.|
| ignorePunctuation | boolean | Yes| Yes| Whether punctuation is ignored. The value can be **true** or **false**.|
| collation | string | Yes| Yes| Rule for sorting regions. The value can be any of the following: **big5han**, **compat**, **dict**, **direct**, **ducet**, **eor**, **gb2312**, **phonebk**, **phonetic**, **pinyin**, **reformed**, **searchjl**, **stroke**, **trad**, **unihan**, **zhuyin**.|
| numeric | boolean | Yes| Yes| Whether numeric collation is used. The value can be **true** or **false**.|
| caseFirst | string | Yes| Yes| Whether upper case or lower case is sorted first. The value can be **upper**, **lower**, or **false**.|
## PluralRules<sup>8+</sup>
...
...
@@ -491,7 +523,7 @@ Create a **PluralRules** object.
| localeMatcher | string | Yes| Yes| Locale matching algorithm. The value can be **lookup** or **best fit**.<br>**System capability**: SystemCapability.Global.I18n|
| type | string | Yes| Yes| Sorting type. The value can be **cardinal** or **ordinal**.<br>**System capability**: SystemCapability.Global.I18n|
| minimumIntegerDigits | number | Yes| Yes| Minimum number of digits allowed in the integer part of a number. The value ranges from **1** to **21**.<br>**System capability**: SystemCapability.Global.I18n|
| minimumFractionDigits | number | Yes| Yes| Minimum number of digits in the fraction part of a number. The value ranges from **0** to **20**.<br>**System capability**: SystemCapability.Global.I18n|
| maximumFractionDigits | number | Yes| Yes| Maximum number of digits in the fraction part of a number. The value ranges from **1** to **21**.<br>**System capability**: SystemCapability.Global.I18n|
| minimumSignificantDigits | number | Yes| Yes| Minimum number of the least significant digits. The value ranges from **1** to **21**.<br>**System capability**: SystemCapability.Global.I18n|
| maximumSignificantDigits | number | Yes| Yes| Maximum number of the least significant digits. The value ranges from **1** to **21**.<br>**System capability**: SystemCapability.Global.I18n|
| localeMatcher | string | Yes| Yes| Locale matching algorithm. The value can be **lookup** or **best fit**.|
| type | string | Yes| Yes| Sorting type. The value can be **cardinal** or **ordinal**.|
| minimumIntegerDigits | number | Yes| Yes| Minimum number of digits allowed in the integer part of a number. The value ranges from **1** to **21**.|
| minimumFractionDigits | number | Yes| Yes| Minimum number of digits in the fraction part of a number. The value ranges from **0** to **20**.|
| maximumFractionDigits | number | Yes| Yes| Maximum number of digits in the fraction part of a number. The value ranges from **1** to **21**.|
| minimumSignificantDigits | number | Yes| Yes| Minimum number of the least significant digits. The value ranges from **1** to **21**.|
| maximumSignificantDigits | number | Yes| Yes| Maximum number of the least significant digits. The value ranges from **1** to **21**.|
## RelativeTimeFormat<sup>8+</sup>
...
...
@@ -568,7 +602,7 @@ Creates a **RelativeTimeFormat** object.
@@ -577,7 +611,7 @@ Creates a **RelativeTimeFormat** object.
Parameters
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| locale | string\|Array<string> | Yes| A string containing locale information, including the language, optional script, and region.|
| locale | string\| Array<string> | Yes| A string containing locale information, including the language, optional script, and region.|
| options | [RelativeTimeFormatInputOptions](#relativetimeformatinputoptions) | No| Options for creating a **RelativeTimeFormat** object.|
- Example
...
...
@@ -588,7 +622,7 @@ Parameters
### format<sup>8+</sup>
format(value: numeric, unit: string): string
format(value: number, unit: string): string
Formats the value and unit based on the specified locale and formatting options.
...
...
@@ -597,8 +631,8 @@ Formats the value and unit based on the specified locale and formatting options.
- Parameters
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | numeric | Yes| Value to format.|
| unit | string | Yes| Unit to format. The value can be any of the following: year, quarter, month, week, day, hour, minute, second.|
| value | number | Yes| Value to format.|
| unit | string | Yes| Unit to format. The value can be any of the following: **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, **second**.|
- Return value
| Type| Description|
...
...
@@ -614,7 +648,7 @@ Formats the value and unit based on the specified locale and formatting options.
Returns an array of RelativeTimeFormat objects in parts for locale-aware formatting.
...
...
@@ -623,13 +657,13 @@ Returns an array of RelativeTimeFormat objects in parts for locale-aware formatt
- Parameters
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | numeric | Yes| Value to format.|
| unit | string | Yes| Unit to format. The value can be any of the following: year, quarter, month, week, day, hour, minute, second.|
| value | number | Yes| Value to format.|
| unit | string | Yes| Unit to format. The value can be any of the following: **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, **second**.|
- Return value
| Type| Description|
| -------- | -------- |
| Array<Object> | An array of **RelativeTimeFormat** objects in parts.|
| Array<object> | An array of **RelativeTimeFormat** objects in parts.|
- Example
```
...
...
@@ -662,20 +696,24 @@ Obtains the formatting options for **RelativeTimeFormat** objects.
Represents the properties of a **RelativeTimeFormat** object.
| localeMatcher | string | Yes| Yes| Locale matching algorithm. The value can be **lookup** or **best fit**.<br>**System capability**: SystemCapability.Global.I18n|
| numeric | string | Yes| Yes| Format of the output message. The value can be **always** or **auto**.<br>**System capability**: SystemCapability.Global.I18n|
| style | string | Yes| Yes| Length of an internationalized message. The value can be **long**, **short**, or **narrow**.<br>**System capability**: SystemCapability.Global.I18n|
| localeMatcher | string | Yes| Yes| Locale matching algorithm. The value can be **lookup** or **best fit**.|
| numeric | string | Yes| Yes| Format of the output message. The value can be **always** or **auto**.|
| style | string | Yes| Yes| Length of an internationalized message. The value can be **long**, **short**, or **narrow**.|
| locale | string | Yes| Yes| A string containing locale information, including the language, optional script, and region.<br>**System capability**: SystemCapability.Global.I18n|
| numeric | string | Yes| Yes| Format of the output message. The value can be **always** or **auto**.<br>**System capability**: SystemCapability.Global.I18n|
| style | string | Yes| Yes| Length of an internationalized message. The value can be **long**, **short**, or **narrow**.<br>**System capability**: SystemCapability.Global.I18n|