question

timboxtest1 avatar image
timboxtest1 asked timboxtest1 edited

[BUG-CLOVER-API] How to calculate percentageDecimal for serviceCharge?

How to calculate the percentageDecimal in serviceCharge when the percentage number is less of 1%.

I would like to apply a service charge of 208.00 that it is equals 0.527634877% to an order with

subtotal 41496.00 amount.


Example:

Subtotal Order Amount: 41496.00

Subtotal Order Amount (Applied discounts): 39421.20

Total Charge to Apply: (208.00 * 100 / 39421.20) = 0.527634877%


Regarding with documentation, is required to charge 10,000 times the percentage:(https://docs.clover.com/reference/orderapplyservicecharge).


Example:

Percentage Decimal : (0.527634877 x 10,000) = 5276.34877

In the receipt is displaying wrong number 207.99 instead 208.00.


screen-shot-2022-05-31-at-30258-pm.png


The percentageDecimal field is Integer, that is the reason is taking the number 5276.

How is way to calculate the right percentage.

Regards!!

REST API
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
timboxtest1 avatar image
timboxtest1 answered

any update?

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community