Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📏 Display decimal parts in numeric statistics #4828

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ export default {
},
referendum: { stage: {} },
projectToken: {
ammBuyTxFees: 10_000,
ammSellTxFees: 20_000,
ammBuyTxFees: 1_000,
ammSellTxFees: 2_000,
bloatBond: joy(0.1),
maxYearlyPatronageRate: 500_000,
minAmmSlopeParameter: joy(10),
minRevenueSplitDuration: 100,
minRevenueSplitTimeToStart: 200,
minSaleDuration: 300,
salePlatformFee: 30_000,
salePlatformFee: 3_000,
},
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export interface NumericValueStatProps extends StatisticItemProps {
}

export const NumericValueStat: FC<NumericValueStatProps> = (props) => {
if (!isDefined(props.value)) {
const value = typeof props.value === 'number' ? props.value.toString() : props.value

if (!isDefined(value)) {
return (
<StatisticItem {...props}>
<span>-</span>
Expand All @@ -22,7 +24,7 @@ export const NumericValueStat: FC<NumericValueStatProps> = (props) => {

return (
<StatisticItem {...props}>
<NumericValue>{formatTokenValue(props.value)}</NumericValue>
<NumericValue>{formatTokenValue(value)}</NumericValue>
{props.children}
</StatisticItem>
)
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/mocks/data/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ const proposalDetails: Record<ProposalDetailsType, RecursivePartial<ProposalWith
SetEraPayoutDampingFactorProposalDetails: { dampingFactor: 60 },
DecreaseCouncilBudgetProposalDetails: { amount: joy(100) },
UpdateTokenPalletTokenConstraintsProposalDetails: {
maxYearlyRate: 0.4 * 10 ** 6,
maxYearlyRate: 400_000,
minAmmSlope: undefined,
minSaleDuration: 200,
minRevenueSplitDuration: undefined,
minRevenueSplitTimeToStart: 5,
salePlatformFee: 10_000,
salePlatformFee: 0,
ammBuyTxFees: undefined,
ammSellTxFees: 0.003 * 10 ** 6,
ammSellTxFees: 300,
bloatBond: joy(0.01),
},
}
Expand Down
Loading