Skip to content
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

Improve the number formatting with input validation and customizable separators #38

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

Kritika75
Copy link
Contributor

@Kritika75 Kritika75 commented Oct 6, 2024

Hey @UTSAVS26 I made the following changes in number formatting and test number formatting files:

  1. Added input validation to check if the input is an integer or a float, raising a ValueError if not
  2. Introduced parameters thousands_sep and decimal_sep, allowing customization of thousands and decimal separators.
  3. Added logic to replace the default thousands and decimal separators with user-defined ones, ensuring that the function can format numbers according to different localization standards and included the additional examples

And for test file:

  1. Added a test case to check if the function correctly formats numbers with custom thousands and decimal separators.
  2. Added a test to ensure that the function raises a ValueError when the input is invalid (not an integer or float).
  3. Proper formatting of integers and floats and handling of negative numbers.

numberformatting

Issue number #29

Copy link
Contributor

github-actions bot commented Oct 6, 2024

👋 Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly!

Feel free to join our community on Discord to discuss more!

@github-actions github-actions bot requested a review from UTSAVS26 October 6, 2024 23:46
@Kritika75
Copy link
Contributor Author

Also @UTSAVS26 if everything is fine please provide the labels to my pr, thank you

@UTSAVS26 UTSAVS26 merged commit 1aadd45 into UTSAVS26:main Oct 7, 2024
1 check passed
@UTSAVS26 UTSAVS26 added hacktoberfest Issues or PRs that qualify for Hacktoberfest contributions. hacktoberfest-accepted Pull requests that are accepted for Hacktoberfest contributions, even if not merged. Contributor level1 gssoc-ext labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor gssoc-ext hacktoberfest Issues or PRs that qualify for Hacktoberfest contributions. hacktoberfest-accepted Pull requests that are accepted for Hacktoberfest contributions, even if not merged. level1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants