Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
csoreff committed Mar 11, 2024
1 parent 5c03ac9 commit bce7725
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/services/lite/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ export const calculateChoiceTotal = (choice_voters: any[], decimals: any) => {
}

export const calculateWeightXTZ = (choice: Choice, totalXTZ: number) => {
let choiceTotal = new BigNumber(0)
if (choice && choice.walletAddresses.length > 0) {
choiceTotal = calculateChoiceTotal(choice.walletAddresses, 6)
return (choiceTotal / totalXTZ) * 100
if !(choice && choice.walletAddresses.length > 0) {
return 0
}
return 0
const choiceTotal = calculateChoiceTotal(choice.walletAddresses, 6)
const percent = choiceTotal.div(totalXTZ).multipliedBy(100)
return percent
}

export const calculateXTZTotal = (choices: Choice[] | undefined) => {
Expand Down

0 comments on commit bce7725

Please sign in to comment.