open-southeners/byte-unit-converter
PHP 8.1+ utility to convert byte sizes between multiple units with no dependencies. Inspired by macOS ByteCountFormatter, it helps format and convert storage values consistently for apps and libraries.
Collection methods) for safer arithmetic in services, jobs, or event handlers (e.g., order processing, analytics).asRound type shift).GMP, BCMath) for heavy computations or custom rounding logic.For Executives: "This package standardizes how we handle numeric operations in Laravel—like a ‘math layer’ for financial, storage, or data-heavy features. The immutable design prevents bugs from accidental state changes, and the new rounding defaults (e.g., 2 decimal places) align with common business needs like invoicing or reporting. It’s a low-risk way to reduce errors in critical workflows without reinventing the wheel. For example, if we’re building a cloud storage API, this ensures file sizes are displayed consistently (e.g., ‘1.23 GB’) and avoids manual rounding errors in billing."
For Engineering:
*"Version 3.0 adds safe arithmetic operations (add/sub) that return new objects (no side effects), and refactors asRound to default to 2 decimals—useful for currency or metrics. The breaking change is minor: update asRound calls to use boolean or int (e.g., asRound(2) instead of asRound(true)). Ideal for services where numeric consistency matters more than performance. Key benefits:
asRound usages in existing codebases.
Recommendation: Pilot in a non-critical feature (e.g., storage metrics) before rolling out globally."*How can I help you explore Laravel packages today?