fix: update logic of Percent function

This commit is contained in:
dudaodong committed 2023-05-18 10:11:48 +08:00
1 parent cd91e16b26
commit f05477d9cf
5 files changed
+29 -19

No files matched your search

+10 -7
View File
@@ -365,15 +365,18 @@ import (
)
func main() {
result1 := mathutil.Percent(1, 2, 2)
result2 := mathutil.Percent(0.1, 0.3, 2)
result1 := Percent(1, 2, 2)
result2 := Percent(0.1, 0.3, 2)
result3 := Percent(-30305, 408420, 2)
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
// Output:
// 0.5
// 0.33
// Output:
// 50
// 33.33
// -7.42
}
```
+10 -7
View File
@@ -365,15 +365,18 @@ import (
)
func main() {
result1 := mathutil.Percent(1, 2, 2)
result2 := mathutil.Percent(0.1, 0.3, 2)
result1 := Percent(1, 2, 2)
result2 := Percent(0.1, 0.3, 2)
result3 := Percent(-30305, 408420, 2)
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
// Output:
// 0.5
// 0.33
// Output:
// 50
// 33.33
// -7.42
}
```