Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FedexService.cs #9

Open
wants to merge 1 commit into
base: nopcommerce-4.60
Choose a base branch
from

Conversation

borissedov
Copy link

The existing behaviour leads to XSD scheme validation errors. The dimensions suppose to be passed as Integer values.

The existing behaviour leads to XSD scheme validation errors. The dimensions suppose to be passed as Integer values.
@c4l3b
Copy link

c4l3b commented Jan 3, 2024

@borissedov this calculation is technically incorrect. FedEx wants you to round fractions to the nearest whole inch.
So 4.4 becomes 4 and 4.5 becomes 5.
Your change may result in undersized calculation.
https://www.fedex.com/en-us/shipping/packaging/what-is-dimensional-weight.html

@borissedov
Copy link
Author

I understand that it may cause rounding issue but the Fedex API doesn’t accept float values for this field. I have found it in our project and want to share the experience.

@c4l3b
Copy link

c4l3b commented Jan 3, 2024

Yes I understand. I would suggest that you do actual rounding using Math.Round() instead of simply casting to an integer. This will make the value correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants