We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8553070 commit db93106Copy full SHA for db93106
src/FileSize.php
@@ -156,7 +156,7 @@ public function as($unitString, $precision = 2)
156
}
157
158
/**
159
- * Get the filesize in a human-friendly string.
+ * Get the filesize as a human-friendly string.
160
*
161
* @param int $precision Round to this many decimal places
162
* @return string
@@ -170,6 +170,16 @@ public function asAuto($precision = 2)
170
return self::formatNumber($size, $precision, $unit);
171
172
173
+ /**
174
+ * Print the filesize as a human-friendly string.
175
+ *
176
+ * @return string
177
+ */
178
+ public function __toString()
179
+ {
180
+ return $this->asAuto();
181
+ }
182
+
183
184
* Change the filesize unit measurement using arbitrary units.
185
0 commit comments