// String produces stats for this file
String produces stats for this file
// String produces stats for this file
func (acc *Account) String() string {
	a, b := acc.progress()
	_, cur := acc.speed()
	eta, etaok := acc.eta()
	etas := "-"
	if etaok {
		if eta > 0 {
			etas = fmt.Sprintf("%v", eta)
		} else {
			etas = "0s"
		}
	}
	name := []rune(acc.name)
	if fs.Config.StatsFileNameLength > 0 {
		if len(name) > fs.Config.StatsFileNameLength {
			where := len(name) - fs.Config.StatsFileNameLength
			name = append([]rune{'.', '.', '.'}, name[where:]...)
		}
	}
	if fs.Config.DataRateUnit == "bits" {
		cur = cur * 8
	}
	percentageDone := 0
	if b > 0 {
		percentageDone = int(100 * float64(a) / float64(b))
	}
	done := fmt.Sprintf("%2d%% /%s", percentageDone, fs.SizeSuffix(b))
	return fmt.Sprintf("%45s: %s, %s/s, %s",
		string(name),
		done,
		fs.SizeSuffix(cur),
		etas,
	)
}
func ( acc * Account ) String ( ) string { a , b := acc . progress ( ) _ , cur := acc . speed ( ) eta , etaok := acc . eta ( ) etas := " " if etaok { if eta > 0 { etas = fmt . Sprintf ( " " , eta ) } else { etas = " " } } name := [ ] rune ( acc . name ) if fs . Config . StatsFileNameLength > 0 { if len ( name ) > fs . Config . StatsFileNameLength { where := len ( name ) - fs . Config . StatsFileNameLength name = append ( [ ] rune { '.' , '.' , '.' } , name [ where : ] ... ) } } if fs . Config . DataRateUnit == " " { cur = cur * 8 } percentageDone := 0 if b > 0 { percentageDone = int ( 100 * float64 ( a ) / float64 ( b ) ) } done := fmt . Sprintf ( " " , percentageDone , fs . SizeSuffix ( b ) ) return fmt . Sprintf ( " " , string ( name ) , done , fs . SizeSuffix ( cur ) , etas , ) }
String produces stats for this file
String produces stats for this file