def val_mb ( valstr : Union [ int , str ] ) -> str : try : return "{:.3f}" . format ( int ( valstr ) / ( 1024 * 1024 ) ) except ( TypeError , ValueError ) : return '?'
python conver megabyte to number
Converts a value in bytes ( in string format ) to megabytes .
def val_mb(valstr: Union[int, str]) -> str:
    """
    Converts a value in bytes (in string format) to megabytes.
    """
    try:
        return "{:.3f}".format(int(valstr) / (1024 * 1024))
    except (TypeError, ValueError):
        return '?'