Skip to content

Conversation

Sheape
Copy link
Contributor

@Sheape Sheape commented Sep 19, 2025

Fixes #87.
This PR adds custom unit conversions for all units that returns as f64. The following new methods are added:

  • as_kb()
  • as_kib()
  • as_mb()
  • as_mib()
  • as_gb()
  • as_gib()
  • as_tb()
  • as_tib()
  • as_pb()
  • as_pib()
  • as_eb()
  • as_eib()

Note that this has a lossy conversion for filesizes larger than 9_007_199_254_740_992 or ~9 PB.

@Sheape Sheape changed the title Add custom unit conversions feat: Add custom unit conversions Sep 19, 2025
@Sheape Sheape changed the title feat: Add custom unit conversions feat: add custom unit conversions Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Custom formatting

1 participant