Changeset View
Changeset View
Standalone View
Standalone View
applets/systemmonitor/net/contents/ui/net.qml
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 42 | delegate: DoublePlotter { | |||
---|---|---|---|---|---|
43 | function formatData(data) { | 43 | function formatData(data) { | ||
44 | var value = data.value * 1024 * 8 | 44 | var value = data.value * 1024 * 8 | ||
45 | if (value > (1024 * 1024)) { | 45 | if (value > (1024 * 1024)) { | ||
46 | return i18nc("%1 is the displayed data transfer speed in megabits per second", "%1 Mbps", (value / (1024 * 1024)).toFixed(1)); | 46 | return i18nc("%1 is the displayed data transfer speed in megabits per second", "%1 Mbps", (value / (1024 * 1024)).toFixed(1)); | ||
47 | } | 47 | } | ||
48 | if (value > 1024) { | 48 | if (value > 1024) { | ||
49 | return i18nc("%1 is the displayed data transfer speed in kilobits per second", "%1 Kbps", (value / 1024)); | 49 | return i18nc("%1 is the displayed data transfer speed in kilobits per second", "%1 Kbps", (value / 1024)); | ||
50 | } | 50 | } | ||
51 | if (value > 0) { | | |||
52 | return i18nc("%1 is the displayed data transfer speed in bits per second", "%1 bps", value); | 51 | return i18nc("%1 is the displayed data transfer speed in bits per second", "%1 bps", value); | ||
53 | } | 52 | } | ||
54 | return value; | | |||
55 | } | | |||
56 | } | 53 | } | ||
57 | } | 54 | } |