SAP-archive/cloud-sdk-currency-conversion

Investigate on calculation and rounding of SingleFixedRateConversionResult

Closed this issue · 1 comments

I haven't noticed this before, but shouldn't rounding happen here instead of outside? You could use completely different amounts to "build" the result. I think from a safety aspect it makes sense to move this here, right?

// pass only the converted amount
export function buildSingleFixedRateConversionResult(
  convertedAmount: CurrencyAmount
): SingleFixedRateConversionResult {
  return {
    convertedAmount,
    // round the converted amount
    roundedOffConvertedAmount: doTheRounding(convertedAmount)
  };

Originally posted by @marikaner in #6 (comment)

This repository is deprecated.