From b1332d7ff7ffa8b6ed997bdab58a964383543bf7 Mon Sep 17 00:00:00 2001 From: qw4990 Date: Thu, 28 Mar 2019 16:49:44 +0800 Subject: [PATCH] update comments --- types/time.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/time.go b/types/time.go index 950bb43cb3d7a..733b4fc732664 100644 --- a/types/time.go +++ b/types/time.go @@ -421,9 +421,11 @@ func RoundFrac(t gotime.Time, fsp int) (gotime.Time, error) { } // TruncateFrac truncates fractional seconds precision with new fsp and returns a new one. +// 2011:11:11 10:10:10.888888 round 0 -> 2011:11:11 10:10:10 +// 2011:11:11 10:10:10.111111 round 0 -> 2011:11:11 10:10:10 func TruncateFrac(t gotime.Time, fsp int) (gotime.Time, error) { if _, err := CheckFsp(fsp); err != nil { - return t, errors.Trace(err) + return t, err } return t.Truncate(gotime.Duration(math.Pow10(9-fsp)) * gotime.Nanosecond), nil }