Skip to content

Commit

Permalink
fix: wrong rounding in project claim flow
Browse files Browse the repository at this point in the history
  • Loading branch information
efstajas committed Jul 11, 2023
1 parent 77f92da commit 53e9ccc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/utils/project/GitProjectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,9 @@ export default class GitProjectService {
for (const [urlOrAddress, percentage] of dependenciesInput) {
const isAddr = isAddress(urlOrAddress);

const weight =
Math.floor((Number(percentage) / 100) * 1000000) *
(highLevelPercentages['dependencies'] / 100);
const weight = Math.floor(
(Number(percentage) / 100) * 1000000 * (highLevelPercentages['dependencies'] / 100),
);

if (weight === 0) continue;

Expand Down Expand Up @@ -489,9 +489,9 @@ export default class GitProjectService {
const maintainersSplitsMetadata: z.infer<typeof addressDriverSplitReceiverSchema>[] = [];

for (const [address, percentage] of maintainersInput) {
const weight =
Math.floor((Number(percentage) / 100) * 1000000) *
(highLevelPercentages['maintainers'] / 100);
const weight = Math.floor(
(Number(percentage) / 100) * 1000000 * (highLevelPercentages['maintainers'] / 100),
);

if (weight === 0) continue;

Expand Down

0 comments on commit 53e9ccc

Please sign in to comment.