-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[10.x] Add a Number
utility class
#48845
Merged
+339
−0
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
b5fb4a9
Create a new Number utility class
caendesilva fb0e6ce
Add a `Number::bytesToHuman()` helper
caendesilva 66655b4
Add a `Number::toHuman()` helper
caendesilva 8290812
Use lowercase `k` for kilobytes
caendesilva 21ed5e0
Update Support package to suggest `ext-intl`
caendesilva d59942b
Throw if extension is not installed when using NumberFormatter wrapper
caendesilva 8151a80
Add a `Number::toCurrency()` helper
caendesilva 9a2704f
Make Number helper locale parameters null and default to App locale
caendesilva d2adff7
Add a `Number::format()` helper
caendesilva 692f0e4
Fix number tests
caendesilva cd6117b
Add a `Number::toPercent()` helper
caendesilva fa8e3b8
Rename Number toHuman helper to spellout
caendesilva 4b69ee5
Create new `Number::toHuman()` helper
caendesilva 3f2fc5f
Change toHuman implementation to better match Rails version
caendesilva 31285d1
Update toHuman helper to better handle extreme numbers
caendesilva ec8ba4b
Clean up toHuman helper
caendesilva 6d3a6c2
formatting
taylorotwell 47da238
formatting
taylorotwell 79be940
formatting
taylorotwell 5ff420d
formatting
taylorotwell cf1bc44
formatting
taylorotwell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There has been some discussion whether we should use
kB
orKB
.It's worth noting that Rails uses
KB
. https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html