diff --git a/api/@ohos.i18n.d.ts b/api/@ohos.i18n.d.ts index 3001b54bd872b1acad1bd2aa1e3103b793207dc4..9151c84d22042920ceef3cd57191c4885b17a9b9 100644 --- a/api/@ohos.i18n.d.ts +++ b/api/@ohos.i18n.d.ts @@ -123,6 +123,41 @@ export function getSystemLocale(): string; */ export function setSystemLocale(locale: string): boolean; +/** + * Provides util functions. + * + * @since 8 + */ +export interface Util { + /** + * Convert from unit to to unit and format according to the locale. + * @param fromUnit Information of the unit to be converted. + * @param toUnit Information about the unit to be converted to. + * @param value Indicates the number to be formatted. + * @param locale The locale to be used. + * @param style The style of format. + * @since 8 + */ + unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale: string, style?: string): string; +} + +/** + * Provides the options of unit. + * + * @since 8 + */ +export interface UnitInfo { + /** + * Unit name. + */ + unit: string + + /** + * The measurement system of the unit. + */ + measureSystem: string +} + /** * Provides the options of PhoneNumberFormat. * diff --git a/api/@ohos.intl.d.ts b/api/@ohos.intl.d.ts index 5cfb03b1f0d49ab7ae4bd5229fdfbe44b18635b8..7d22699942624e18264526d31b0a0e60fefcc543 100755 --- a/api/@ohos.intl.d.ts +++ b/api/@ohos.intl.d.ts @@ -304,6 +304,11 @@ export interface NumberOptions { */ unitDisplay: string + /** + * Indicates the unit display format. + */ + unitUsage: string + /** * Indicates the sign display format. */