mirror of
https://github.com/sstent/go-garth-cli.git
synced 2026-01-25 16:42:48 +00:00
17 lines
231 B
Go
17 lines
231 B
Go
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 "-"
|
|
}
|