mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-11 08:12:26 +08:00
fix: update logic of Percent function
This commit is contained in:
@@ -60,7 +60,7 @@ func Percent(val, total float64, n int) float64 {
|
||||
if total == 0 {
|
||||
return float64(0)
|
||||
}
|
||||
tmp := val / total
|
||||
tmp := val / total * 100
|
||||
result := RoundToFloat(tmp, n)
|
||||
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user