LAPP标准接口程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
662 B

package transfer
import (
"math"
"strconv"
"time"
)
func StringToInt(source string) (data int, err error) {
return strconv.Atoi(source)
}
func IntToString(source int) (data string) {
return strconv.Itoa(source)
}
func DecimalToIntAbandon(source float64) (data int) {
return int(source)
}
func DecimalToIntRound(source float64) (data int) {
return int(math.Floor(source + 0.5))
}
func DecimalToIntCeil(source float64) (data int) {
return int(math.Ceil(source))
}
func DecimalToIntFloor(source float64) (data int) {
return int(math.Floor(source))
}
func TimeToString(source time.Time, format string) (data string) {
return source.Format(format)
}