Improve ByteSizeMarkup::create to support a precision parameter

Created on 20 December 2016, almost 8 years ago
Updated 28 June 2024, 6 months ago

Problem/Motivation

The ByteSizeMarkup::create function always rounds the size output to two decimal places. This can be too specific for certain tasks, for example, some sites may prefer to display "52 KB" instead of "52.46 KB".

Proposed resolution

* Update ByteSizeMarkup::create to accept an optional precision parameter.
* Set the default value of precision to 2, so that existing uses of ByteSizeMarkup::create are unaffected.
* Write tests
* Write change record / code examples

Remaining tasks

  1. Write change record / code examples

User interface changes

n/a

API changes

tbc

Data model changes

n/a

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 7 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom nicrodgers Monmouthshire, UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024