Custom percentage procedure for starr apps. Returns an unsigned integer 0-100.
(remaining, total float64)
| 400 | // Custom percentage procedure for starr apps. |
| 401 | // Returns an unsigned integer 0-100. |
| 402 | func percent(remaining, total float64) uint { |
| 403 | const oneHundred = 100.0 |
| 404 | |
| 405 | if remaining == 0 { |
| 406 | return oneHundred |
| 407 | } |
| 408 | |
| 409 | return uint(oneHundred - (remaining / total * oneHundred)) |
| 410 | } |
no outgoing calls
no test coverage detected