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

Method _get_cm

Lib/pagebot/toolbox/units.py:560–570  ·  view source on GitHub ↗

Answers the rendered value, translated to cm via pt. >>> int(round(pt(595).cm)) # Rendered and cast to cm 21 >>> inch(5).cm == pt(5*72).cm True >>> mm(50).cm 5

(self)

Source from the content-addressed store, hash-verified

558 p = property(_get_p)
559
560 def _get_cm(self):
561 """Answers the rendered value, translated to cm via pt.
562
563 >>> int(round(pt(595).cm)) # Rendered and cast to cm
564 21
565 >>> inch(5).cm == pt(5*72).cm
566 True
567 >>> mm(50).cm
568 5
569 """
570 return asIntOrFloat(self.pt/Cm.PT_FACTOR)
571 cm = property(_get_cm)
572
573 def _get_mm(self):

Callers

nothing calls this directly

Calls 1

asIntOrFloatFunction · 0.90

Tested by

no test coverage detected