Template:Datacalc/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 50: Line 50:
|-
|-
| {{param|round}}
| {{param|round}}
| Used to round up the output string
| Used to round up the output string to the specified power.
| {{CodeBlock|margin=5px|<nowiki>| round = 2 </nowiki>}}
| {{CodeBlock|margin=5px|<nowiki>| round = 2 </nowiki>}}
| {{datacalc|1000|output=kb|prefix=binary|round=2}}
| {{datacalc|1000|output=kb|prefix=binary|round=2}}

Revision as of 23:36, 2 June 2023

Edit-copy.png
This is a documentation subpage for Template:Datacalc.
Don't forget to purge the contents of the base page upon creating or editing this subpage.
Template:Datacalc
Logo-template.png
Summary
Converts a filesize string
Type
Mathematics template
Contributors
Creation date
02/06/2023
(02 June 2022)
Notes
N/A
Subpages
Documentation
Preload
N/A
Sandbox
N/A
Strings
N/A
Testcases
N/A
Other
N/A
Revision information
Latest editor
Mailmanmicky
Last edited
02/06/2023
20230602233658
Revision size
1967 bytes
1.967 kilobytes
0.001967 megabytes
Technical information
Page identifier
53975
Contains translations
No
Uses parser functions?
Yes
Uses variables?
No

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

{{Datacalc | 1 = | output = }}

Usage & Preview

{{Datacalc}}
Parameter Description Example Preview
No parameters Template defaults to displaying 0 bytes
N/A
0 bytes
{{{1}}} Input string, interpreted by default as bytes.
| 1 = 1000
1000 bytes
{{{id}}} Specifies what to do with the identifier.
| id = abbreviate

| id = none
1 kB
1
{{{prefix}}} Unit prefix; determinant for exponential power.
| prefix = binary
0.9765625 kibibytes
{{{round}}} Used to round up the output string to the specified power.
| round = 2
0.98 kibibytes
{{{output}}} Input filesize, i.e.: kilobytes.
| output = kb
1 kilobytes