mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2026-03-14 14:35:44 +01:00
Don't format zero bandwidth as "unlimited".
This commit is contained in:
parent
ea55d5508b
commit
dca35b46d4
3 changed files with 12 additions and 6 deletions
|
|
@ -56,10 +56,8 @@ func (b Bandwidth) String() string {
|
|||
return formatWithRemainder(b.Bits(), Megabit.Bits(), "Mbps")
|
||||
} else if b >= Kilobit {
|
||||
return formatWithRemainder(b.Bits(), Kilobit.Bits(), "Kbps")
|
||||
} else if b > 0 {
|
||||
return fmt.Sprintf("%d bps", b)
|
||||
} else {
|
||||
return "unlimited"
|
||||
return fmt.Sprintf("%d bps", b)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ func TestBandwidthString(t *testing.T) {
|
|||
}{
|
||||
{
|
||||
0,
|
||||
"unlimited",
|
||||
"0 bps",
|
||||
},
|
||||
{
|
||||
BandwidthFromBits(123),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue