Abuse filter editor, Bureaucrats, Check users, Interface administrators, Staff, Suppressors, Administrators, Translation Reviewer
2,193
edits
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
end | end | ||
function p. | function p.raw_blocks_to_kib(blocks) | ||
return blocks * 128 | return blocks * 128 | ||
end | end | ||
function p. | function p.raw_blocks_to_mib(blocks) | ||
return blocks / 8 | return blocks / 8 | ||
end | end | ||
Line 23: | Line 23: | ||
end | end | ||
function p. | function p.raw_mib_to_blocks(mib) | ||
return math.ceil( | return math.ceil(mib * 8) | ||
end | |||
function p.raw_format_bytes(bytes) | |||
-- this needs to do bytes, kib, and gib too | |||
return string.format("%.2f", bytes / 1024 / 1024) .. ' MiB' | |||
end | end | ||
Line 39: | Line 44: | ||
end | end | ||
function p. | function p.blocks_to_kib(frame) | ||
return p. | return p.raw_blocks_to_kib(frame.args[1]) | ||
end | end | ||
function p. | function p.blocks_to_mib(frame) | ||
return p. | return p.raw_blocks_to_mib(frame.args[1]) | ||
end | end | ||
Line 51: | Line 56: | ||
end | end | ||
function p. | function p.mib_to_blocks(frame) | ||
return p. | return p.raw_mib_to_blocks(frame.args[1]) | ||
end | |||
function p.format_bytes(frame) | |||
return p.raw_format_bytes(frame.args[1]) | |||
end | end | ||
return p | return p |