first commit

This commit is contained in:
2025-09-21 18:27:25 +08:00
commit 02e1c4bd63
528 changed files with 55690 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package lzUtils
import "fmt"
// ToWechatAmount 将金额从元转换为微信支付 SDK 需要的分int64 类型)
func ToWechatAmount(amount float64) int64 {
// 将金额从元转换为分,并四舍五入
return int64(amount*100 + 0.5)
}
// ToAlipayAmount 将金额从元转换为支付宝支付 SDK 需要的字符串格式,保留两位小数
func ToAlipayAmount(amount float64) string {
// 格式化为字符串,保留两位小数
return fmt.Sprintf("%.2f", amount)
}