mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-27 06:23:08 +08:00
feat: add conversion logic from integer to english (#5540)
* feat: add conversion logic from integer to english * feat: update DIRECTORY.md * feat: fix linting issues * feat: fix build issue * feat: address review comments --------- Co-authored-by: sailok.chinta <sailok.chinta@kotak.com> Co-authored-by: Alex Klymenko <alexanderklmn@gmail.com>
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
package com.thealgorithms.conversions;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class IntegerToEnglishTest {
|
||||
|
||||
@Test
|
||||
public void testIntegerToEnglish() {
|
||||
assertEquals("Two Billion One Hundred Forty Seven Million Four Hundred Eighty Three Thousand Six Hundred Forty Seven", IntegerToEnglish.integerToEnglishWords(2147483647));
|
||||
assertEquals("One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven", IntegerToEnglish.integerToEnglishWords(1234567));
|
||||
assertEquals("Twelve Thousand Three Hundred Forty Five", IntegerToEnglish.integerToEnglishWords(12345));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user