Commit 102f059d by pengbao666

修改AmountCips类型校验bug

parent 6aeeb14f
......@@ -57,6 +57,9 @@ export function amountCIPSValidator(isM, desc, sca) {
callback(new Error(desc + " Cannot be null"));
}else if(!flag){
callback(new Error("Amount Cannot be null"));
}else{
console.log("Amount success")
callback();
}
} else if (sca.length === 2) {
const totalDig = sca[0];
......@@ -64,6 +67,7 @@ export function amountCIPSValidator(isM, desc, sca) {
if (amtValue.indexOf(".") == -1) {
//不包含小数点
if (amtValue.length <= totalDig) {
console.log("Amount success")
callback();
} else {
callback(new Error("The total number of digits cannot exceed" + totalDig));
......@@ -78,10 +82,12 @@ export function amountCIPSValidator(isM, desc, sca) {
} else if (integerNumber + decimalNumber > totalDig) {
callback(new Error("The total number of digits cannot exceed" + totalDig));
} else {
console.log("Amount success")
callback();
}
}
} else {
console.log("Amount success")
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