Skip to content

Instantly share code, notes, and snippets.

@rodoabad
Created June 10, 2018 07:43
Show Gist options
  • Save rodoabad/0587c49d46d7e22a78bc3d39c986fe22 to your computer and use it in GitHub Desktop.
Save rodoabad/0587c49d46d7e22a78bc3d39c986fe22 to your computer and use it in GitHub Desktop.
export const adjustDividendAmountForSplits = (dividend, splits) => {
const applicableSplits = findApplicableSplitsAgainstDividendYear(dividend.exDate, splits);
const divAmountWithAppliedSplitRatios = applySplitsRatiosToMatchingDividendAmount(dividend.amount, applicableSplits);
return new BigNumber(divAmountWithAppliedSplitRatios).decimalPlaces(defaultDecimalPlaces).toNumber();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment