File tree Expand file tree Collapse file tree
main/java/com/thealgorithms/conversions
test/java/com/thealgorithms/conversions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -171,7 +171,9 @@ private static BigDecimal convertWordQueueToBigDecimal(ArrayDeque<String> wordDe
171171 List <BigDecimal > chunks = new ArrayList <>();
172172
173173 boolean isNegative = "negative" .equals (wordDeque .peek ());
174- if (isNegative ) wordDeque .poll ();
174+ if (isNegative ) {
175+ wordDeque .poll ();
176+ }
175177
176178 boolean prevNumWasHundred = false ;
177179 boolean prevNumWasPowerOfTen = false ;
@@ -189,6 +191,9 @@ private static BigDecimal convertWordQueueToBigDecimal(ArrayDeque<String> wordDe
189191 prevNumWasHundred = true ;
190192 continue ;
191193 }
194+ default -> {
195+
196+ }
192197 }
193198 prevNumWasHundred = false ;
194199
@@ -213,7 +218,12 @@ private static BigDecimal convertWordQueueToBigDecimal(ArrayDeque<String> wordDe
213218 currentChunk = BigDecimal .ZERO ;
214219 continue ;
215220 }
216- case "negative" -> handleNegative (isNegative );
221+ case "negative" -> {
222+ handleNegative (isNegative );
223+ }
224+ default -> {
225+
226+ }
217227 }
218228
219229 throw new WordsToNumberException (WordsToNumberException .ErrorType .UNKNOWN_WORD , word );
@@ -224,7 +234,8 @@ private static BigDecimal convertWordQueueToBigDecimal(ArrayDeque<String> wordDe
224234 }
225235
226236 BigDecimal completeNumber = combineChunks (chunks );
227- return isNegative ? completeNumber .multiply (BigDecimal .valueOf (-1 )) :
237+ return isNegative ? completeNumber .multiply (BigDecimal .valueOf (-1 ))
238+ :
228239 completeNumber ;
229240 }
230241
Original file line number Diff line number Diff line change 11package com .thealgorithms .conversions ;
22
33import static org .junit .jupiter .api .Assertions .assertEquals ;
4- import static org .junit .jupiter .api .Assertions .assertNull ;
54import static org .junit .jupiter .api .Assertions .assertThrows ;
65
76import java .math .BigDecimal ;
You can’t perform that action at this time.
0 commit comments