Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

feat: number format menu item adds scientific notation (#4895)

wpxp123456d4278357fed7
diff --git a/packages/sheets-numfmt-ui/src/controllers/menu.ts b/packages/sheets-numfmt-ui/src/controllers/menu.ts
index a13d5e5a14..a6a726c569 100644
--- a/packages/sheets-numfmt-ui/src/controllers/menu.ts
+++ b/packages/sheets-numfmt-ui/src/controllers/menu.ts
@@ -48,6 +48,14 @@ export const MENU_OPTIONS: Array<{ label: string; pattern: string | null } | '|'
label: 'sheet.numfmt.number',
pattern: '0',
},
+ {
+ label: 'sheet.numfmt.percent',
+ pattern: '0.00%',
+ },
+ {
+ label: 'sheet.numfmt.scientific',
+ pattern: '0.00E+00',
+ },
'|',
{
label: 'sheet.numfmt.accounting',
@@ -83,11 +91,6 @@ export const MENU_OPTIONS: Array<{ label: string; pattern: string | null } | '|'
pattern: 'h:mm:ss',
},
'|',
- {
- label: 'sheet.numfmt.percent',
- pattern: '0.00%',
- },
- '|',
{
label: 'sheet.numfmt.moreFmt',
pattern: '',
diff --git a/packages/sheets-numfmt-ui/src/locale/en-US.ts b/packages/sheets-numfmt-ui/src/locale/en-US.ts
index 3da430371d..e5557acdde 100644
--- a/packages/sheets-numfmt-ui/src/locale/en-US.ts
+++ b/packages/sheets-numfmt-ui/src/locale/en-US.ts
@@ -19,7 +19,6 @@ import type zhCN from './zh-CN';
const locale: typeof zhCN = {
sheet: {
numfmt: {
- percent: 'Percentage',
title: 'Number format',
numfmtType: 'Format types',
cancel: 'Cancel',
@@ -28,6 +27,8 @@ const locale: typeof zhCN = {
accounting: 'Accounting',
text: 'Text',
number: 'Number',
+ percent: 'Percentage',
+ scientific: 'Scientific',
currency: 'Currency',
date: 'Date',
time: 'Time',
diff --git a/packages/sheets-numfmt-ui/src/locale/fa-IR.ts b/packages/sheets-numfmt-ui/src/locale/fa-IR.ts
index 4229f3ab5b..db83d2980d 100644
--- a/packages/sheets-numfmt-ui/src/locale/fa-IR.ts
+++ b/packages/sheets-numfmt-ui/src/locale/fa-IR.ts
@@ -19,7 +19,6 @@ import type zhCN from './zh-CN';
const locale: typeof zhCN = {
sheet: {
numfmt: {
- percent: 'درصد',
title: 'قالب‌بندی عدد',
numfmtType: 'انواع قالب‌بندی',
cancel: 'انصراف',
@@ -28,6 +27,8 @@ const locale: typeof zhCN = {
accounting: 'حسابداری',
text: 'متن',
number: 'عدد',
+ percent: 'درصد',
+ scientific: 'علمی',
currency: 'ارز',
date: 'تاریخ',
time: 'زمان',
diff --git a/packages/sheets-numfmt-ui/src/locale/fr-FR.ts b/packages/sheets-numfmt-ui/src/locale/fr-FR.ts
index b28a870f47..9e08ed4fc8 100644
--- a/packages/sheets-numfmt-ui/src/locale/fr-FR.ts
+++ b/packages/sheets-numfmt-ui/src/locale/fr-FR.ts
@@ -19,7 +19,6 @@ import type enUS from './en-US';
const locale: typeof enUS = {
sheet: {
numfmt: {
- percent: 'Pourcentage',
title: 'Format de nombre',
numfmtType: 'Types de format',
cancel: 'Annuler',
@@ -28,6 +27,8 @@ const locale: typeof enUS = {
accounting: 'Comptabilité',
text: 'Texte',
number: 'Nombre',
+ percent: 'Pourcentage',
+ scientific: 'Scientifique',
currency: 'Devise',
date: 'Date',
time: 'Heure',
diff --git a/packages/sheets-numfmt-ui/src/locale/ru-RU.ts b/packages/sheets-numfmt-ui/src/locale/ru-RU.ts
index 1f75097b61..7835c73ab5 100644
--- a/packages/sheets-numfmt-ui/src/locale/ru-RU.ts
+++ b/packages/sheets-numfmt-ui/src/locale/ru-RU.ts
@@ -19,7 +19,6 @@ import type zhCN from './zh-CN';
const locale: typeof zhCN = {
sheet: {
numfmt: {
- percent: 'Процент',
title: 'Формат числа',
numfmtType: 'Типы форматов',
cancel: 'Отмена',
@@ -28,6 +27,8 @@ const locale: typeof zhCN = {
accounting: 'Бухгалтерский',
text: 'Текст',
number: 'Число',
+ percent: 'Процент',
+ scientific: 'Экспоненциальный',
currency: 'Валюта',
date: 'Дата',
time: 'Время',
diff --git a/packages/sheets-numfmt-ui/src/locale/vi-VN.ts b/packages/sheets-numfmt-ui/src/locale/vi-VN.ts
index ea43a690db..3fd610d9d0 100644
--- a/packages/sheets-numfmt-ui/src/locale/vi-VN.ts
+++ b/packages/sheets-numfmt-ui/src/locale/vi-VN.ts
@@ -19,7 +19,6 @@ import type zhCN from './zh-CN';
const locale: typeof zhCN = {
sheet: {
numfmt: {
- percent: 'Phần trăm',
title: 'Định dạng số',
numfmtType: 'Loại định dạng',
cancel: 'Hủy bỏ',
@@ -28,6 +27,8 @@ const locale: typeof zhCN = {
accounting: 'Kế toán',
text: 'Văn bản',
number: 'Số',
+ percent: 'Phần trăm',
+ scientific: 'Chính xác',
currency: 'Tiền tệ',
date: 'Ngày',
time: 'Thời gian',
diff --git a/packages/sheets-numfmt-ui/src/locale/zh-CN.ts b/packages/sheets-numfmt-ui/src/locale/zh-CN.ts
index c5e5b1743e..439df276a5 100644
--- a/packages/sheets-numfmt-ui/src/locale/zh-CN.ts
+++ b/packages/sheets-numfmt-ui/src/locale/zh-CN.ts
@@ -17,7 +17,6 @@
const locale = {
sheet: {
numfmt: {
- percent: '百分比',
title: '数字格式',
numfmtType: '格式类型',
cancel: '取消',
@@ -26,6 +25,8 @@ const locale = {
accounting: '会计',
text: '文本',
number: '数值',
+ percent: '百分比',
+ scientific: '科学记数',
currency: '货币',
date: '日期',
time: '时间',
diff --git a/packages/sheets-numfmt-ui/src/locale/zh-TW.ts b/packages/sheets-numfmt-ui/src/locale/zh-TW.ts
index 36ec1f2657..c049e93664 100644
--- a/packages/sheets-numfmt-ui/src/locale/zh-TW.ts
+++ b/packages/sheets-numfmt-ui/src/locale/zh-TW.ts
@@ -19,7 +19,6 @@ import type zhCN from './zh-CN';
const locale: typeof zhCN = {
sheet: {
numfmt: {
- percent: '百分比',
title: '數字格式',
numfmtType: '格式類型',
cancel: '取消',
@@ -28,6 +27,8 @@ const locale: typeof zhCN = {
accounting: '會計',
text: '文字',
number: '數值',
+ percent: '百分比',
+ scientific: '工程型',
currency: '貨幣',
date: '日期',
time: '時間',