blob: 8228d2be651155d4edd033af2f5758309d22f2ab (
plain)
1
2
3
4
5
6
7
8
9
|
"""Time Utilities."""
from __future__ import annotations
__all__ = ('maybe_s_to_ms',)
def maybe_s_to_ms(v: int | float | None) -> int | None:
"""Convert seconds to milliseconds, but return None for None."""
return int(float(v) * 1000.0) if v is not None else v
|