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.

23 lines
441 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 convert
import "strconv"
// IntToStr int类型转字符串
// num int类型的数据不区分int64或者int类型
func (c *Conv) IntToStr(num any) string {
var str string
switch num.(type) {
case int:
str = strconv.Itoa(num.(int))
case int64:
str = strconv.FormatInt(num.(int64), 10)
case int32:
str = strconv.FormatInt(int64(num.(int32)), 10)
case string:
str = num.(string)
default:
str = ""
}
return str
}