MCPcopy Index your code
hub / github.com/archlinux/archinstall / format_size

Method format_size

archinstall/lib/models/device.py:401–411  ·  view source on GitHub ↗
(
		self,
		target_unit: Unit,
		sector_size: SectorSize | None = None,
		include_unit: bool = True,
	)

Source from the content-addressed store, hash-verified

399 )
400
401 def format_size(
402 self,
403 target_unit: Unit,
404 sector_size: SectorSize | None = None,
405 include_unit: bool = True,
406 ) -> str:
407 target_size = self.convert(target_unit, sector_size)
408
409 if include_unit:
410 return f'{target_size.value} {target_unit.name}'
411 return f'{target_size.value}'
412
413 def binary_unit_highest(self, include_unit: bool = True) -> str:
414 binary_units = Unit.get_binary_units()

Callers 11

as_textMethod · 0.95
table_dataMethod · 0.95
lvm_vol_reduceFunction · 0.80
lvm_vol_createFunction · 0.80
table_dataMethod · 0.80
__init__Method · 0.80
_prompt_sizeMethod · 0.80
table_dataMethod · 0.80
table_dataMethod · 0.80
serialize_sizeMethod · 0.80

Calls 1

convertMethod · 0.95

Tested by

no test coverage detected