Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
田翔
xform
Commits
e1dbab74
Commit
e1dbab74
authored
Dec 11, 2023
by
程恺文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数字转科学计数法
parent
21415009
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
index.js
src/core/widgets/settings/groupStyle/Formatting/index.js
+9
-0
index.js
src/core/widgets/text/NumberInput/index.js
+13
-1
No files found.
src/core/widgets/settings/groupStyle/Formatting/index.js
View file @
e1dbab74
/*
* @Author: 634665781 634665781@qq.com
* @Date: 2023-12-06 09:16:37
* @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-12-11 16:46:25
* @FilePath: \xform\src\core\widgets\settings\groupStyle\Formatting\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
React
from
'react'
import
{
Input
,
Dropdown
,
Menu
,
Select
}
from
'antd'
import
{
PlusOutlined
}
from
'@ant-design/icons'
...
...
@@ -8,6 +16,7 @@ const options = [
{
label
:
'小数'
,
value
:
'${小数}'
},
{
label
:
'货币'
,
value
:
'${货币}'
},
{
label
:
'百分比'
,
value
:
'${百分比}'
},
{
label
:
'科学计数法'
,
value
:
'${科学计数法}'
}
]
const
Formatting
=
(
props
)
=>
{
...
...
src/core/widgets/text/NumberInput/index.js
View file @
e1dbab74
/*
* @Author: 634665781 634665781@qq.com
* @Date: 2023-12-06 09:16:37
* @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-12-11 17:07:06
* @FilePath: \xform\src\core\widgets\text\NumberInput\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
React
,
{
useEffect
,
useMemo
,
useState
}
from
'react'
import
{
InputNumber
}
from
'antd'
import
styles
from
'./index.less'
...
...
@@ -48,7 +56,11 @@ const NumberInput = (props) => {
return
`
${
parseInt
(
value
)}
`
}
else
if
(
formatter
===
'${小数}'
)
{
return
Number
(
value
).
toFixed
(
Number
(
decimalDigits
))
}
else
if
(
formatter
)
{
}
else
if
(
formatter
===
'${科学计数法}'
){
return
Number
(
value
).
toExponential
()
}
else
if
(
formatter
)
{
return
`
${
value
}${
formatter
}
`
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment