C
C#12mo 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
Angius12mo ago
Cast that total to a float
MODiX
MODiX12mo 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
Angius12mo ago
This times 100 is still 0
Ewan
EwanOP12mo ago
oooo? ok ill try that
Angius
Angius12mo ago
Or try total / 35f * 100f
Ewan
EwanOP12mo ago
AH ok it worked thank you! i get catshy
Want results from more Discord servers?
Add your server