Skip to content

Commit

Permalink
Adjust the voting percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedHanafy725 committed Sep 19, 2024
1 parent 2c0f1b1 commit 05b7a89
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/lib/widgets/dao/show_result_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ class _ShowResultDialogState extends State<ShowResultDialog>
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
)),
Text(totalVotes == 0 ? '0%' : '${(yesVotes / totalVotes) * 100}%',
Text(
totalVotes == 0
? '0%'
: '${((yesVotes / totalVotes) * 100).toStringAsFixed(0)}%',
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
)),
Expand All @@ -151,7 +154,10 @@ class _ShowResultDialogState extends State<ShowResultDialog>
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
)),
Text(totalVotes == 0 ? '0%' : '${noVotes / totalVotes * 100}%',
Text(
totalVotes == 0
? '0%'
: '${(noVotes / totalVotes * 100).toStringAsFixed(0)}%',
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
)),
Expand Down

0 comments on commit 05b7a89

Please sign in to comment.