Use number_format() instead of round() on ByteSizeMarkup::create()

Created on 8 May 2025, 2 days ago

Problem/Motivation

Cosinder this piece of code:

ByteSizeMarkup::create(932023)

We expect it to return 910,18 KB, but in fact it returns 910.1799999999999 KB.

Proposed resolution

This is because round() is not working properly and number_format() should be used to display rounded value.

πŸ› Bug report
Status

Needs work

Version

11.1 πŸ”₯

Component

base system

Created by

πŸ‡΅πŸ‡±Poland gugalamaciek

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

Comments & Activities

Production build 0.71.5 2024