mirror of
https://github.com/sstent/go-garth-cli.git
synced 2026-01-26 09:01:58 +00:00
sync
This commit is contained in:
16
python-garmin-connect/connect/nzf.go
Normal file
16
python-garmin-connect/connect/nzf.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// nzf is a type that will print "-" instead of 0.0 when used as a stringer.
|
||||
type nzf float64
|
||||
|
||||
func (nzf nzf) String() string {
|
||||
if nzf != 0.0 {
|
||||
return fmt.Sprintf("%.01f", nzf)
|
||||
}
|
||||
|
||||
return "-"
|
||||
}
|
||||
Reference in New Issue
Block a user