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

[Feature]: Add support for compact representations in input and output #58

Merged
merged 9 commits into from
Jul 31, 2023

Conversation

LcyDev
Copy link
Collaborator

@LcyDev LcyDev commented Jul 30, 2023

This pull request adds support for compact representations, converting large numbers in a more concise format.

Additionally, the code for amount validation in MoneyCMD has been refactored to improve code maintainability.

About:
Compact representations are used to abbreviate large numeric values using metric prefixes, to make them more human-readable. Allowing to represent billions as 1.5B

These changes will enhance user experience and it provides better flexibility to manage how numeric values are represented.

Issues related:

Changed incorporated:

  • Implemented compact representations for input and output/display.
  • Compact representations won't round numbers upwards and they can display up to 3 fraction digits.
  • Refactored repeated code for amount validation in MoneyCMD
  • Implemented temporal translation for the new entry format_amount_error
  • Introduced a configuration option plugin.economy.compact_display

@LcyDev LcyDev changed the title [Feature]: Add support for metric compact representations in both [Feature]: Add support for compact representations in input and output Jul 30, 2023
@LcyDev
Copy link
Collaborator Author

LcyDev commented Jul 30, 2023

@EncryptSL Please review my rebased pull request.

@LcyDev
Copy link
Collaborator Author

LcyDev commented Jul 30, 2023

Testing Unit

  • Values: '', NaN, INF, -1, 0.001: ❌
  • Variating: 0 (Set ✅/ Add ❌)
  • Non-compact chars: 10X: ❌
  • Compact: 10.245K = 10,245.00

Copy link
Owner

@EncryptSL EncryptSL left a comment

Choose a reason for hiding this comment

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

Looks fine for me.

@LcyDev LcyDev merged commit 31d7588 into EncryptSL:main Jul 31, 2023
@LcyDev LcyDev deleted the compact branch July 31, 2023 20:30
@LcyDev LcyDev self-assigned this Aug 1, 2023
@LcyDev LcyDev added Improvements New improvements NotBug This is a not bug. Approved Status approved Priority Low Priorioty Low labels Aug 1, 2023
@LcyDev LcyDev linked an issue Aug 1, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Status approved Improvements New improvements NotBug This is a not bug. Priority Low Priorioty Low
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Compact representations using metric prefixes
2 participants