diff options
| author | Nikolaus Gotsche <n@softwarefools.com> | 2018-09-15 10:58:27 +0200 |
|---|---|---|
| committer | Nikolaus Gotsche <n@softwarefools.com> | 2018-09-15 10:58:27 +0200 |
| commit | 8f1891352a2f3296d5edf4ba7688d16ea2053266 (patch) | |
| tree | ee2f7f5d7f1bfb449a86184de8d51a1da7b10b8d | |
| parent | 7848ecdbcabc728fe11df1943096682f1f89d89b (diff) | |
Tried to force it for go 1.70.2.3
| -rw-r--r-- | main.go | 2 | ||||
| -rwxr-xr-x | makefile | 6 | ||||
| -rw-r--r-- | utils.go | 11 |
3 files changed, 14 insertions, 5 deletions
@@ -65,7 +65,7 @@ func init() { "Open a different Database than specified in Configuration") // CUSTOMIZE USAGE flag.Usage = func() { - fmt.Fprintf(os.Stderr, "Usage of %s Version %s (%s):\n %s [Options] args\n\n Arguments: use 'help' to get the full list \n\n [Options]:\n", os.Args[0],version,compdate,os.Args[0]) + fmt.Fprintf(os.Stderr, "Usage of %s Version %s (%s):\n %s [Options] <Commands>\n\nOptions:\n", os.Args[0],version,compdate,os.Args[0]) flag.PrintDefaults() } @@ -1,4 +1,4 @@ -version=$(shell git tag --points-at) +version=$(shell git tag --points-at HEAD) date=$(shell date "+%b %Y") name=laboravi .PHONY: all @@ -22,6 +22,6 @@ fetch_stuff: @go get github.com/fatih/color @go get github.com/mattn/go-sqlite3 @go get github.com/abiosoft/ishell - @mkdir outpdf - @mkdir outtex + @mkdir -p outpdf + @mkdir -p outtex @echo "All nessecary libaries installed" @@ -133,8 +133,17 @@ func string2StringArray(in string,delim string)(out []string) { return } +func RetardRound(x float64) float64 { + t := math.Trunc(x) + if math.Abs(x-t) >= 0.5 { + return t + math.Copysign(1, x) + } + return t +} + func Round(x, unit float64) (float64) { - return math.Round(x/unit) * unit +// return math.Round(x/unit) * unit + return RetardRound(x/unit) * unit } func cleanString(in string) (out string) { |
