Skip to content

Commit

Permalink
Display decimal parts in numeric statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
thesan committed Apr 9, 2024
1 parent ba72dd4 commit f262e30
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
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

0 comments on commit f262e30

Please sign in to comment.