mirror of
https://github.com/kristoferssolo/traxor.git
synced 2025-10-21 20:10:35 +00:00
feat: display blank 0
This commit is contained in:
parent
c17c0ebffa
commit
2a3975963c
@ -24,6 +24,9 @@ impl FileSize {
|
|||||||
|
|
||||||
impl ToString for FileSize {
|
impl ToString for FileSize {
|
||||||
fn to_string(&self) -> String {
|
fn to_string(&self) -> String {
|
||||||
|
if self.0 == 0 {
|
||||||
|
return "0".to_string();
|
||||||
|
}
|
||||||
match self.0 as f64 {
|
match self.0 as f64 {
|
||||||
b if b >= 1e12 => self.to_tb(),
|
b if b >= 1e12 => self.to_tb(),
|
||||||
b if b >= 1e9 => self.to_gb(),
|
b if b >= 1e9 => self.to_gb(),
|
||||||
|
|||||||
@ -20,6 +20,9 @@ impl NetSpeed {
|
|||||||
|
|
||||||
impl ToString for NetSpeed {
|
impl ToString for NetSpeed {
|
||||||
fn to_string(&self) -> String {
|
fn to_string(&self) -> String {
|
||||||
|
if self.0 == 0 {
|
||||||
|
return "0".to_string();
|
||||||
|
}
|
||||||
match self.0 as f64 {
|
match self.0 as f64 {
|
||||||
b if b >= 1e9 => self.to_gbps(),
|
b if b >= 1e9 => self.to_gbps(),
|
||||||
b if b >= 1e6 => self.to_mbps(),
|
b if b >= 1e6 => self.to_mbps(),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user