github.com/angenalZZZ/gofunc@v0.0.0-20210507121333-48ff1be3917b/f/float_test.go (about) 1 package f_test 2 3 import ( 4 "github.com/angenalZZZ/gofunc/f" 5 "testing" 6 ) 7 8 func TestRound(t *testing.T) { 9 v := 0.22673826 10 f1, f2 := f.Round(v, 3), f.Floor(v, 5) 11 // Output: 0.227 12 t.Log(f1) 13 // Output: 0.22673 14 t.Log(f2) 15 }