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.

53 lines
943 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package ConvertUtil
import (
"dsSso/Const/ErrorConst"
"dsSso/Utils/LogUtil"
"strconv"
)
/**
功能将in64转为string
作者:黄海
时间2020-03-24
*/
func Int64ToString(int64 int64) string {
return strconv.FormatInt(int64, 10)
}
/**
功能string到int
作者:黄海
时间2020-03-24
*/
func StringToInt(string string) int {
int, err := strconv.Atoi(string)
if err != nil {
LogUtil.Error(ErrorConst.ConvertError, "将字符串转为整数时失败!"+err.Error())
}
return int
}
/**
功能string到int64
作者:黄海
时间2020-03-24
*/
func StringToInt64(string string) int64 {
int64, err := strconv.ParseInt(string, 10, 64)
if err != nil {
LogUtil.Error(ErrorConst.ConvertError, "将字符串转为int64时失败"+err.Error())
}
return int64
}
/**
功能int到string
作者:黄海
时间2020-03-24
*/
func IntToString(int int) string {
string := strconv.Itoa(int)
return string
}