Skip to content

Instantly share code, notes, and snippets.

@rodoabad
Created June 10, 2018 07:25
Show Gist options
  • Select an option

  • Save rodoabad/b8b6b0c48f4fb1d99cf7c1eebd3e6451 to your computer and use it in GitHub Desktop.

Select an option

Save rodoabad/b8b6b0c48f4fb1d99cf7c1eebd3e6451 to your computer and use it in GitHub Desktop.
export const adjustDividendAmountForSplits = (dividend, splits) => {
const dividendAmount = new BigNumber(dividend.amount);
const applicableSplits = findApplicableSplitsAgainstDividendYear(dividend.exDate, splits);
const divAmountWithAppliedSplitRatios = applySplitsRatiosToMatchingDividendAmount(dividendAmount, applicableSplits);
return divAmountWithAppliedSplitRatios.decimalPlaces(defaultDecimalPlaces).toNumber();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment