-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add a set of memory conversion methods to bevy_utils #5460
Comments
I disagree, this doesn't need to be part of Bevy. |
Closing until we can find a clear motivation. This may fit well as a truly external crate that we import for the editor. |
quick search found https://crates.io/crates/unit-conversions |
For the record, I didn't use it in my PR because I didn't want to add a crate for what was essentially just a multiplication in my case. Once we start needing to show this in a more friendly manner in the future editor that crate would be a good starting point, but it doesn't have a distinction between GiB and GB which is not ideal in my opinion. It's a bit weird considering they do have KiB vs KB. |
Also that crate doesn't help to automatically display the more convenient unit based on the value. |
We should see about PRs to fix those limitations upstream (and existing alternatives) before trying to fork IMO. |
Actually, I was not thinking to do unit conversion (as returned value), but just formatting a value. We can easily achieve it by creating a newtype on a numeric value (e.g. i64) and implement the |
I would actually prefer to have a function on
bevy_utils
that formats a memory measurement toKiB
,MiB
,GiB
, ... depending on the value. Memory measurements will be quite common in game engines.Originally posted by @Nilirad in #5454 (comment)
The text was updated successfully, but these errors were encountered: