You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,8 @@ By default all values are rounded to the nearest integer.
41
41
```
42
42
> 513 KiB
43
43
44
-
Increasing the precision with `setPrecision($precision)` allows the specified amount of digits after the decimal point.
44
+
The default precision can be increased with `setPrecision($precision)`. Increasing the precision allows the specified amount of digits after the decimal point.
45
+
45
46
```php
46
47
(new ByteFormatter)->setPrecision(2)->format(0x80233);
47
48
```
@@ -55,6 +56,13 @@ needed.
55
56
```
56
57
> 512.5 KiB
57
58
59
+
The default precision can be overridden on a per-format basis using the optional precision argument to `format()`.
60
+
61
+
```php
62
+
(new ByteFormatter)->setPrecision(2)->format(0x80233, 4);
0 commit comments