public class BalanceDecimal extends Object implements Iterable<BigDecimal>
| Modifier and Type | Method and Description |
|---|---|
BigDecimal |
get(int i) |
BigDecimal |
getPrecision() |
@NotNull Iterator<BigDecimal> |
iterator() |
static BalanceDecimal |
of(BigDecimal total,
List<BigDecimal> items)
balance the number with the count, and the scale is 2 (0.01)
20/6 = [3.33, 3.33, 3.34, 3.33, 3.33, 3.34]
|
static BalanceDecimal |
of(BigDecimal total,
List<BigDecimal> items,
int scale)
balance the number with the count, and the assigned scale
20/6 = [3.33, 3.33, 3.34, 3.33, 3.33, 3.34]
|
int |
scale() |
int |
size() |
BigDecimal |
total() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static BalanceDecimal of(BigDecimal total, List<BigDecimal> items)
total - the number to be averageditems - the partpublic static BalanceDecimal of(BigDecimal total, List<BigDecimal> items, int scale)
total - the number to be averageditems - the partscale - the item's scale@NotNull public @NotNull Iterator<BigDecimal> iterator()
iterator in interface Iterable<BigDecimal>public BigDecimal get(int i)
public int size()
public BigDecimal total()
public int scale()
public BigDecimal getPrecision()
Copyright © 2023. All rights reserved.