- 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

how to change discount amount 0 Answers

Apply Discount in android 1 Answer

Adding a Modifier to a LineItem Via SDK 2 Answers

ClientException: cannot update one or more of these fields: LineItem When adding TaxRate 1 Answer

Void an Order on clover 1 Answer

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