MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / PreformatValue

Method PreformatValue

eos/gamedata.py:709–717  ·  view source on GitHub ↗

Attributes have to be translated certain ways based on their unit (ex: decimals converting to percentages). This allows us to get an easy representation of how the attribute should be printed

(self, value)

Source from the content-addressed store, hash-verified

707 return "%s (%d)" % (attribute.name.capitalize(), v)
708
709 def PreformatValue(self, value):
710 """Attributes have to be translated certain ways based on their unit (ex: decimals converting to percentages).
711 This allows us to get an easy representation of how the attribute should be printed """
712
713 override = self.translations.get(self.name)
714 if override is not None:
715 return override[1](value), override[2](self.displayName)
716
717 return value, self.displayName
718
719 def SimplifyValue(self, value):
720 """Takes the internal representation value and convert it into the display value"""

Callers 2

_preformatValueMethod · 0.80
GetDataMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected