C
C#14mo ago
Ewan

✅ Trying to calculate percentage value to 2dp

Im trying to get a total out of 35 and then find the percentage value to 2dp but it gives 0 for some reason, help!
No description
6 Replies
Angius
Angius14mo ago
Cast that total to a float
MODiX
MODiX14mo ago
Angius
REPL Result: Success
15 / 35
15 / 35
Result: int
0
0
Compile: 299.662ms | Execution: 22.957ms | React with ❌ to remove this embed.
Angius
Angius14mo ago
This times 100 is still 0
Ewan
EwanOP14mo ago
oooo? ok ill try that
Angius
Angius14mo ago
Or try total / 35f * 100f
Ewan
EwanOP14mo ago
AH ok it worked thank you! i get catshy

Did you find this page helpful?