Display win percentage

This commit is contained in:
Florine W. Dekker 2020-08-25 14:44:52 +02:00
parent ae49acda9e
commit 7af33026a4
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "minesweeper", "name": "minesweeper",
"version": "0.81.6", "version": "0.81.7",
"description": "Just Minesweeper!", "description": "Just Minesweeper!",
"author": "Felix W. Dekker", "author": "Felix W. Dekker",
"browser": "dist/bundle.js", "browser": "dist/bundle.js",

View File

@ -198,11 +198,15 @@ export class LocalStatistics implements Statistics {
</tr> </tr>
<tr> <tr>
<th>Games completed</th> <th>Games completed</th>
<td>${this.gamesWon}</td> <td>
${this.gamesWon}&nbsp;(${Math.round(100 * this.gamesWon / this.gamesStarted)}%)
</td>
</tr> </tr>
<tr> <tr>
<th>Games completed without losing</th> <th>Games completed without losing</th>
<td>${this.gamesWonWithoutLosing}</td> <td>
${this.gamesWonWithoutLosing}&nbsp;(${Math.round(100 * this.gamesWonWithoutLosing / this.gamesStarted)}%)
</td>
</tr> </tr>
</table> </table>