Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
994bcf9e
Commit
994bcf9e
authored
May 27, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改公式
parent
d2bce164
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
GeliBusinessPlatform/Define/Define.swift
GeliBusinessPlatform/Define/Define.swift
+17
-8
No files found.
GeliBusinessPlatform/Define/Define.swift
View file @
994bcf9e
...
@@ -129,26 +129,35 @@ func isPurnNumber(str:String)-> Bool{
...
@@ -129,26 +129,35 @@ func isPurnNumber(str:String)-> Bool{
// let expression = "^[0-9]*((\\.|,)[0-9]{0,2})?$"
// let expression = "^[0-9]*((\\.|,)[0-9]{0,2})?$"
if
str
.
count
>
0
{
var
predicateStr
:
String
!
var
currObject
:
String
!
predicateStr
=
"^[0-9]*((
\\
.|,)[0-9]{0,2})?$"
currObject
=
str
let
predicate
=
NSPredicate
(
format
:
"SELF MATCHES %@"
,
predicateStr
)
return
predicate
.
evaluate
(
with
:
currObject
)
}
let
arr
=
str
.
components
(
separatedBy
:
","
)
let
arr
=
str
.
components
(
separatedBy
:
","
)
if
arr
.
count
>
0
{
if
arr
.
count
>
0
{
var
num
=
""
var
num
=
""
for
item
in
arr
{
for
item
in
arr
{
num
+=
item
num
+=
item
}
}
if
num
.
count
>
0
{
var
predicateStr
:
String
!
var
currObject
:
String
!
predicateStr
=
"^[0-9]*((
\\
.|,)[0-9]{0,2})?$"
currObject
=
num
let
predicate
=
NSPredicate
(
format
:
"SELF MATCHES %@"
,
predicateStr
)
return
predicate
.
evaluate
(
with
:
currObject
)
}
if
isPurnInt
(
string
:
num
)
||
isPurnFloat
(
string
:
num
){
if
isPurnInt
(
string
:
num
)
||
isPurnFloat
(
string
:
num
){
return
true
return
true
}
else
{
}
else
{
return
false
return
false
}
}
}
else
{
}
else
{
if
str
.
count
>
0
{
var
predicateStr
:
String
!
var
currObject
:
String
!
predicateStr
=
"^[0-9]*((
\\
.|,)[0-9]{0,2})?$"
currObject
=
str
let
predicate
=
NSPredicate
(
format
:
"SELF MATCHES %@"
,
predicateStr
)
return
predicate
.
evaluate
(
with
:
currObject
)
}
if
isPurnInt
(
string
:
str
)
||
isPurnFloat
(
string
:
str
){
if
isPurnInt
(
string
:
str
)
||
isPurnFloat
(
string
:
str
){
return
true
return
true
}
else
{
}
else
{
...
...
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