Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swifteditor
Overview
Overview
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
daixuan
swifteditor
Commits
c76ebbf9
Commit
c76ebbf9
authored
Dec 29, 2022
by
fukai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持币种忽略小数
parent
bd6212b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
index.html
src/entries/index.html
+2
-0
TagValidater.js
src/swift/TagValidater.js
+16
-0
No files found.
src/entries/index.html
View file @
c76ebbf9
...
...
@@ -37,6 +37,8 @@
];
window
.
BANK_LOGIC_ADDRESS
=
"CHBHHKH0AXXX"
window
.
BANK_BIC
=
"CHBHHKH0XXX"
window
.
IGNORE_DOT_CUR
=
[
'JPY'
,
'KRW'
]
</script>
<script
src=
"./common.js"
></script>
<script
src=
"./index.js"
></script>
...
...
src/swift/TagValidater.js
View file @
c76ebbf9
...
...
@@ -155,6 +155,22 @@ export function TagV(tag,status,value,tno,mty,seqlist,countMap={})
if
(
reg
.
content
==
'AMOUNT'
||
reg
.
content
==
'NUMBER'
||
reg
.
type
==
'd'
)
{
errmsg
[
key
]
=
TestAmt
(
val
,
reg
.
length
)
if
(
reg
.
content
==
'AMOUNT'
&&
/s
\d
/g
.
test
(
key
)){
let
idx
=
key
.
charAt
(
1
);
idx
=
Number
(
idx
);
idx
--
;
let
curkey
=
`s
${
idx
}
`
//币种为忽略小数点的币种
if
(
!
errmsg
[
key
]
&&
val
&&
obj
[
curkey
]
&&
IGNORE_DOT_CUR
.
join
(
","
).
indexOf
(
obj
[
curkey
])
>=
0
)
{
let
dotidx
=
val
.
indexOf
(
"."
);
if
(
dotidx
>
-
1
){
obj
[
key
]
=
val
.
substring
(
0
,
dotidx
);
}
}
}
continue
}
...
...
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