Class \Prado\Web\UI\WebControls\TDataSize
TDataSize produces the size of a file in its natural size for human readability rather than bytes.
<com:TDataSize Size="475837458" UseMarketingSize="true" Abbreviate="true"/>
will output "476 MB".
The TDataSize output depends on \Prado\Web\UI\WebControls\getAbbreviate and \Prado\Web\UI\WebControls\getUseMarketingSize.
\Prado\Web\UI\WebControls\getUseMarketingSize will change the size of a kilobyte to be 1000 rather the technical 1024. This changes the output between bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, zettabytes, and yottabytes for UseMarketingSize="True" (base 1000) and the technical bytes, kibibytes, mebibytes, gibibytes, tebibytes, pebibytes, exbibytes, zebibytes, and yobibytes for UseMarketingSize="False" (base 1024). The singular and plural of these these outputted words are localized.
For \Prado\Web\UI\WebControls\getAbbreviate that is true, with UseMarketingSize="True" then B, KB, MB, GB, TB, PB, EB, ZB, YB is outputted. Otherwise with UseMarketingSize="False" then B, KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiB is outputted. These outputted abbreviations are localized.
Class hierarchy
- \Prado\Web\UI\WebControls\TDataSize
- \Prado\Web\UI\WebControls\TLabel implements IDataRenderer
- \Prado\Web\UI\WebControls\TWebControl implements IStyleable
- \Prado\Web\UI\TControl implements IRenderable, IBindable
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 4.2.0
public
|
|
public
|
|
public
|
|
public
|
renderContents(object $writer) : mixed
renders the size in the closes base, bytes, kilobytes, megabytes,
gigabytes, terabytes, petabytes, exabytes, zettabytes, and yottabytes
for marketing terms, and bytes, kibibytes, mebibytes gibibytes,
tebibytes, pebibytes, exbibytes, zebibytes, and yobibytes for technical
terms.
|
public
|
|
public
|
|
public
|