Skip to content

Prathamesh zingage #6137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 16, 2025
Merged

Conversation

ZingadePrathamesh
Copy link
Contributor

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

Features

  • Whole Number Conversion: Supports numbers from 0 to trillions.
  • Decimal Support: Accurately converts fractional parts of numbers (e.g., 123.45 becomes One Hundred Twenty-Three Point Four Five).
  • Readable Code: Written with clean and modular methods for easy understanding and extension.
  • Customizable: Can be easily modified to support additional languages or features.

Example Usage

Here’s how you can use the NumberToWordsConverter class in your Java application:

import java.math.BigDecimal;

public class Main {

    public static void main(String[] args) {
        BigDecimal testValue = new BigDecimal("145.350");
        System.out.println("In Words: " + NumberToWordsConverter.convert(testValue));

        BigDecimal testValue2 = new BigDecimal("-010000010.01056");
        System.out.println("In Words: " + NumberToWordsConverter.convert(testValue2));
    }
}

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 95.12195% with 2 lines in your changes missing coverage. Please review.

Project coverage is 73.80%. Comparing base (754bf6c) to head (074a046).

Files with missing lines Patch % Lines
...a/com/thealgorithms/conversions/NumberToWords.java 95.12% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6137      +/-   ##
============================================
+ Coverage     73.75%   73.80%   +0.04%     
- Complexity     5126     5143      +17     
============================================
  Files           659      660       +1     
  Lines         17628    17669      +41     
  Branches       3392     3404      +12     
============================================
+ Hits          13001    13040      +39     
  Misses         4120     4120              
- Partials        507      509       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ZingadePrathamesh ZingadePrathamesh marked this pull request as ready for review January 14, 2025 06:18
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak merged commit 466ff0b into TheAlgorithms:master Jan 16, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants