film/base/util/util.go

22 lines
328 B
Go
Raw Normal View History

2023-04-08 20:33:48 +08:00
package util
2023-04-09 02:11:58 +08:00
2023-05-16 09:42:30 +08:00
import (
"fmt"
"regexp"
"strings"
)
2023-04-09 02:11:58 +08:00
func MoneyFen(money int64) string {
return fmt.Sprintf("%.2f", float64(money)/100)
}
2023-05-16 09:42:30 +08:00
func CinemaBrand(name string) string {
reg, err := regexp.Compile("[^(]*")
if err != nil {
panic(err)
}
r := reg.Find([]byte(name))
return strings.Trim(string(r), "\r\n\t ")
}