Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
bom_identify
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5b14b1b3
authored
May 21, 2021
by
陈森彬
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
处理百分比带小数点的情况
parent
1fcdf57b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
utils/functions.py
utils/functions.py
View file @
5b14b1b3
...
...
@@ -137,10 +137,14 @@ def unit_conversion(unit_res, kw):
unit_str
=
unit_str
.
replace
(
"-"
,
""
)
unit_num
=
int
(
kw
.
replace
(
unit_str
,
""
)
.
replace
(
"-"
,
""
))
else
:
unit_num
=
int
(
kw
.
replace
(
unit_str
,
""
))
if
"."
in
kw
:
unit_num
=
float
(
kw
.
replace
(
unit_str
,
""
))
else
:
unit_num
=
int
(
kw
.
replace
(
unit_str
,
""
))
true_unit
=
str
(
delete_extra_zero
(
unit_num
*
unit_data
[
unit_str
]))
elif
"."
in
kw
:
# 处理小数点
unit_num
=
float
(
kw
.
replace
(
unit_str
,
""
))
true_unit
=
str
(
delete_extra_zero
(
unit_num
*
unit_data
[
unit_str
]))
+
unit_key
else
:
unit_num
=
int
(
kw
.
replace
(
unit_str
,
""
))
...
...
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