- Home /

hello all,

clover round discount to next decimal number.

for example

`i have one line item with price 0.85$. and i am applying 10% discount on each line item in order.`

` `

discount amount is 0.09$ but we expecting it 0.085$.

now if i add one more same line item in order then total order amount goes to 1.70$

`this time total discount amount is 0.18$ which should be 0.17$ and we are also expecting total discount to 0.17$ `

i am using the same code provided by clover.

```
Discount discount1 = new Discount();
discount1.setName(discountValue + "% Discount");
discount1.setPercentage(discountValue);
```

whereas discount object only accept long type in setPercentage Method

```
for (LineItem updatedLineItem : updatedLineItems) {
orderConnector.addLineItemDiscount(orderId, updatedLineItem.getId(), discount1);
}
```

can we modify discount amount without round to next decimal number ??

any help would be appreciated.

Comment

Follow
### Follow this Question

Apply Discount in android 1 Answer

How to rename a LineItem Discount ? 0 Answers

Apply Equal Discount on Multiple LineItems. 0 Answers

Adding a Modifier to a LineItem Via SDK 2 Answers

Copyright © 2010-16 DZone, Inc. - All rights reserved.

- Anonymous
- Sign in
- Create
- Ask a question
- Create an article
- Spaces
- Help
- Explore
- Topics
- Questions
- Users
- Badges