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:
Sailok Chinta
2024-10-04 22:43:40 +05:30
committed by GitHub
parent ea6457bf41
commit 389d1d70d5
3 changed files with 96 additions and 0 deletions

View File

@ -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));
}
}