isValid 함수에서 전체 길이는 '.'를 포함하지 않는 정수부 + 소수부 길이로 함
This commit is contained in:
@@ -222,10 +222,11 @@ public class Converter {
|
||||
}
|
||||
String[] data = normalized.split("[.]");
|
||||
if (pointLength > 0) {
|
||||
// length 는 소수점(.) 문자를 제외한 전체 자릿수 규약. 정수부 허용 자릿수 = length - pointLength
|
||||
if (data.length == 1) {
|
||||
if (data[0].length() > length - pointLength - 1) return false;
|
||||
if (data[0].length() > length - pointLength) return false;
|
||||
} else if (data.length == 2) {
|
||||
if (data[0].length() > length - pointLength - 1) return false;
|
||||
if (data[0].length() > length - pointLength) return false;
|
||||
if (data[1].length() > pointLength) return false;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user