Showing
1 changed file
with
7 additions
and
3 deletions
... | @@ -747,6 +747,7 @@ function roadcongest(eventObj, msg){ | ... | @@ -747,6 +747,7 @@ function roadcongest(eventObj, msg){ |
747 | var jsonForcongest = obj; | 747 | var jsonForcongest = obj; |
748 | var number = msg.replace('번', '').trim(); | 748 | var number = msg.replace('번', '').trim(); |
749 | var iscount = 0; | 749 | var iscount = 0; |
750 | + var index = 0; | ||
750 | console.log(number); | 751 | console.log(number); |
751 | count = 0; | 752 | count = 0; |
752 | console.log(count); | 753 | console.log(count); |
... | @@ -771,9 +772,12 @@ function roadcongest(eventObj, msg){ | ... | @@ -771,9 +772,12 @@ function roadcongest(eventObj, msg){ |
771 | } | 772 | } |
772 | roadnumberstringLength = roadnumberstring.length; | 773 | roadnumberstringLength = roadnumberstring.length; |
773 | if(roadnumberstringLength != 0){ | 774 | if(roadnumberstringLength != 0){ |
774 | - iscount = (roadnumberstringLength % 5); | 775 | + roadnumberstring[roadnumberstringLength] = "이상입니다."; |
775 | - for(var i = 0; i < (5-iscount); i++ ){ | 776 | + index = (roadnumberstringLength % 5); |
776 | - roadnumberstring[roadnumberstringLength + i] = "Out of range"; | 777 | + if(index != 0){ |
778 | + for(var i = 1; i <= (4-index); i++ ){ | ||
779 | + roadnumberstring[roadnumberstringLength + i] = "Out of range"; | ||
780 | + } | ||
777 | } | 781 | } |
778 | } | 782 | } |
779 | 783 | ... | ... |
-
Please register or login to post a comment