Template:Datacalc/Doc: Difference between revisions
(Created page with "{{Doc/subpage}} <div style="display:flex;"><div style="flex:1;"> This template interprets a numbered input string (in bytes) and converts it into a specified output filesize. ''For a logical use-case, see Template:Infobox template''. == Copy and Paste == {{CodeBlock|<nowiki>{{Datacalc | 1 = | output = }}</nowiki>}} == Usage & Preview == {{CodeBlock|<nowiki>{{Datacalc}}</nowiki>}} {|class="standard-table" | style="text-align:center; width:100%;" |- ! Parameter ! D...") |
(No difference)
|
Latest revision as of 03:19, 4 January 2025
Undocumented Template You can help the Open Fortress Wiki by writing it. Until then, you'll have to read the source to figure out how to use it anyway. Which, I mean, while you're over there already... just saying, you may as well... |
This template interprets a numbered input string (in bytes) and converts it into a specified output filesize. For a logical use-case, see Template:Infobox template.
Copy and Paste
Usage & Preview
Parameter | Description | Example | Preview |
---|---|---|---|
No parameters | Template defaults to displaying 0 bytes | 0 bytes | |
{{{1}}} | Input string, interpreted by default as bytes. | 1000 bytes | |
{{{id}}} | Specifies what to do with the identifier. | 1000 B 1000 | |
{{{prefix}}} | Unit prefix; determinant for exponential power. | 0.9765625 kibibytes | |
{{{round}}} | Used to round up the output string to the specified power. | 0.98 kibibytes | |
{{{output}}} | Output filesize, i.e.: kilobytes. | 1 kilobytes |
Examples
Non-exponential input
1 kilobytesinput: {{datacalc|1000|output=kb}}
Non-exponential input by the second power
0.9765625 kibibytesinput: {{datacalc|1000|output=kb|prefix=binary}}
Exponential input
1 kilobytesinput: {{datacalc|10^3|output=kb}}
Exponential input by the second power
0.9765625 kibibytesinput: {{datacalc|10^3|output=kb|prefix=binary}}
Filesize with the unit identifier abbreviated
1 kBinput: {{datacalc|1000|output=kb|id=abbreviate}}
Filesize without the unit identifier
1 input: {{datacalc|1000|output=kb|id=none}}
Rounded up to 11/2 power
1 kibibytesinput: {{datacalc|1000|output=kb|prefix=binary|round=1.5}}
Rounded up to the second power
0.98 kibibytesinput: {{datacalc|1000|output=kb|prefix=binary|round=2}}
(02 June 2022)
20250104031934
3.511 kilobytes
0.003511 megabytes