Displaying Sizes and Numbers using Humanize #2762
Open
+75
−13
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.
It's been a long time coming but here goes...
Size (
NexusMods.Paths.Size
) now has a ReactiveUIIBindingTypeConverter
which is globally registered. Whenever a Size is bound to a UI control (normally a TextBlock's Text property) it automatically kicks in.When SizeComponent is used in a TreeDataGrid, Humanize is directly used without the above converter.
Humanize returns either a single decimal point if 1 GB in size or greater, no decimal points if not.
Numbers can be formatted either by Humanize (if need it to say 1.1k instead of 1123) or by using "N0" format for it to have thousand separators. Generally applied in the code-behind in the OneWayBind's
Should we also be using Humanize if we just want thousand separators ?
Closes #2372