Skip to content

Commit dc44d28

Browse files
authored
fix: Round to the smaller number when calculating campaign progress (#2058)
* fix: Round to the smaller number when calculating campaign progress * i18n: Use translated values for campaign states
1 parent b4737a6 commit dc44d28

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/client/campaigns/CampaignProgress.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default function CampaignProgress({
7979
const { t } = useTranslation('campaigns')
8080
const raisedSafe = Math.max(0, raised)
8181
const targetSafe = Math.max(0, target)
82-
const percentage = Math.ceil((raisedSafe / targetSafe) * 100)
82+
const percentage = Math.floor((raisedSafe / targetSafe) * 100)
8383
const progressBarWidth = Math.min(percentage, 100)
8484

8585
const progressBarColorMap = {

src/components/client/campaigns/CampaignStateSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function CampaignStateSelect({ name = 'state' }) {
2323
</MenuItem>
2424
{Object.values(CampaignState).map((value, index) => (
2525
<MenuItem key={index} value={value}>
26-
{value}
26+
{t(`campaigns:campaign-status.${value}`)}
2727
</MenuItem>
2828
))}
2929
</Select>

0 commit comments

Comments
 (0)