Commit 102f059d by pengbao666

修改AmountCips类型校验bug

parent 6aeeb14f
...@@ -57,6 +57,9 @@ export function amountCIPSValidator(isM, desc, sca) { ...@@ -57,6 +57,9 @@ export function amountCIPSValidator(isM, desc, sca) {
callback(new Error(desc + " Cannot be null")); callback(new Error(desc + " Cannot be null"));
}else if(!flag){ }else if(!flag){
callback(new Error("Amount Cannot be null")); callback(new Error("Amount Cannot be null"));
}else{
console.log("Amount success")
callback();
} }
} else if (sca.length === 2) { } else if (sca.length === 2) {
const totalDig = sca[0]; const totalDig = sca[0];
...@@ -64,6 +67,7 @@ export function amountCIPSValidator(isM, desc, sca) { ...@@ -64,6 +67,7 @@ export function amountCIPSValidator(isM, desc, sca) {
if (amtValue.indexOf(".") == -1) { if (amtValue.indexOf(".") == -1) {
//不包含小数点 //不包含小数点
if (amtValue.length <= totalDig) { if (amtValue.length <= totalDig) {
console.log("Amount success")
callback(); callback();
} else { } else {
callback(new Error("The total number of digits cannot exceed" + totalDig)); callback(new Error("The total number of digits cannot exceed" + totalDig));
...@@ -78,10 +82,12 @@ export function amountCIPSValidator(isM, desc, sca) { ...@@ -78,10 +82,12 @@ export function amountCIPSValidator(isM, desc, sca) {
} else if (integerNumber + decimalNumber > totalDig) { } else if (integerNumber + decimalNumber > totalDig) {
callback(new Error("The total number of digits cannot exceed" + totalDig)); callback(new Error("The total number of digits cannot exceed" + totalDig));
} else { } else {
console.log("Amount success")
callback(); callback();
} }
} }
} else { } else {
console.log("Amount success")
callback(); callback();
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment