grants-stack icon indicating copy to clipboard operation
grants-stack copied to clipboard

Cosmetic UI: display figures to always contain 2 decimal places for consistency

Open marsrobertson opened this issue 1 year ago • 1 comments

It immediately got my attention as misaligned. Or maybe by design? I think consistency is better.

image

marsrobertson avatar Aug 20 '24 06:08 marsrobertson

Can i get assigned?

onyedikachi-david avatar Oct 11 '24 16:10 onyedikachi-david

Hey @marsrobertson, @MasterHW , I have a fix for this. To fix the display figures issue you could update the props.crowdfundedUSD component in the ViewRoundPage.tsx. file found in grants-stack\packages\grant-explorer\src\features\round\ViewRoundPage.tsx.

fix :

{props.crowdfundedUSD?.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2, })} This approach will guarantee the amount is always shown in two decimal places on the frontend. Even if it is a whole number.

I'll go ahead and create a draft pull request for this fix.

eben619 avatar Oct 26 '24 18:10 eben619