File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/main/java/nambang_swag/bada_on/entity Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ public void updateWeatherData(String category, String value) {
123123 case "PCP" , "RN1" -> hourlyPrecipitation = parseAccumulation (value , "강수없음" );
124124 case "REH" -> humidity = parseInt (value );
125125 case "SNO" -> hourlySnowAccumulation = parseAccumulation (value , "적설없음" );
126+
126127 }
127128 } catch (NumberFormatException e ) {
128129 throw new IllegalArgumentException ("Failed to parse value: " + value + " for category: " + category , e );
@@ -141,6 +142,12 @@ private float parseAccumulation(String value, String noneString) {
141142 if (value .equals (noneString )) {
142143 return NO_DATA ;
143144 }
145+
146+ if (value .endsWith ("cm미만" )) {
147+ String numericPart = value .substring (0 , value .indexOf ("cm" ));
148+ return Float .parseFloat (numericPart ) / 10 ; // Convert cm to mm
149+ }
150+
144151 return parseFloat (value .split ("mm" )[0 ]);
145152 }
146153}
You can’t perform that action at this time.
0 commit comments