MCPcopy Create free account
hub / github.com/PageBot/PageBot / __repr__

Method __repr__

Lib/pagebot/toolbox/units.py:481–485  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

479 rounded = property(_get_rounded)
480
481 def __repr__(self):
482 v = asIntOrFloat(self.v)
483 if isinstance(v, int):
484 return '%d%s' % (v, self.name.lower())
485 return '%s%s' % (asFormatted(v), self.name.lower())
486
487 def asNormalizedJSON(self):
488 """Answer self as normalized JSON-compatible dict.

Callers

nothing calls this directly

Calls 2

asIntOrFloatFunction · 0.90
asFormattedFunction · 0.90

Tested by

no test coverage detected