CurrantPi\StringHelpers::prettyBaud PHP Method

prettyBaud() public static method

* Figure out of the baud rate should be shown as MB/s, Kb/s or b/s.
public static prettyBaud ( $baud )
    public static function prettyBaud($baud)
    {
        $baud = intval($baud);
        $ret = "unknown";
        if ($baud > 1000000) {
            $baud = round($baud / 1000000, 2);
            $ret = "{$baud} Mb/s";
        } elseif ($baud > 1000) {
            $baud = round($baud / 1000, 2);
            $ret = "{$baud} Kb/s";
        } else {
            $ret = "{$baud} b/s";
        }
        return $ret;
    }