Untitled

Pasted by zyp on Mon Jul 22 22:51:12 2024 UTC as Python console session
>>> f"{Period(us = 5)}"
'5us'
>>> f"{Period(us = 5000)}"
'5ms'
>>> f"{Period(us = 5028)}"
'5.028ms'
>>> f"{Period(us = 5028):.2}"
'5.03ms'
>>> f"{Period(us = 5028):.2ns}"
'5028000.00ns'
>>> f"{Period(us = 5028):MHz}"
'0.000199MHz'
>>> f"{Period(us = 5028):Hz}"
'198.886237Hz'
>>> f"{Period(us = 5028):.3Hz}"
'198.886Hz'
>>> f"{Period(us = 5028):.0Hz}"
'199Hz'
>>> f"{Period(MHz = 125)}"
'8ns'
>>> f"{Period(MHz = 125):GHz}"
'0.125000GHz'
>>> f"{Period(MHz = 125): GHz}"
'0.125000 GHz'
>>> f"{Period(MHz = 125): }"
'8 ns'
>>> f"{Period(MHz = 125):10 }"
'      8 ns'