public enum WeightUnit extends Enum<WeightUnit>
默认舍入模式: RoundingMode.FLOOR
默认舍入精度: 4
Modifier and Type | Method and Description |
---|---|
BigDecimal |
toGram(BigDecimal u) |
abstract BigDecimal |
toGram(BigDecimal u,
int scale,
RoundingMode roundingMode)
?
|
BigDecimal |
toGram(long u) |
BigDecimal |
toGram(long u,
int scale,
RoundingMode roundingMode) |
BigDecimal |
toKilogram(BigDecimal u) |
abstract BigDecimal |
toKilogram(BigDecimal u,
int scale,
RoundingMode roundingMode)
?
|
BigDecimal |
toKilogram(long u) |
BigDecimal |
toKilogram(long u,
int scale,
RoundingMode roundingMode) |
BigDecimal |
toMilligram(BigDecimal u) |
abstract BigDecimal |
toMilligram(BigDecimal u,
int scale,
RoundingMode roundingMode)
?
|
BigDecimal |
toMilligram(long u) |
BigDecimal |
toMilligram(long u,
int scale,
RoundingMode roundingMode) |
BigDecimal |
toTon(BigDecimal u) |
abstract BigDecimal |
toTon(BigDecimal u,
int scale,
RoundingMode roundingMode)
?
|
BigDecimal |
toTon(long u) |
BigDecimal |
toTon(long u,
int scale,
RoundingMode roundingMode) |
static WeightUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static WeightUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final WeightUnit MG
public static final WeightUnit G
public static final WeightUnit KG
public static final WeightUnit T
public static WeightUnit[] values()
for (WeightUnit c : WeightUnit.values()) System.out.println(c);
public static WeightUnit valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic BigDecimal toMilligram(long u)
public BigDecimal toMilligram(long u, int scale, RoundingMode roundingMode)
public BigDecimal toMilligram(BigDecimal u)
public abstract BigDecimal toMilligram(BigDecimal u, int scale, RoundingMode roundingMode)
u
- unitscale
- scaleroundingMode
- roundingModepublic BigDecimal toGram(long u)
public BigDecimal toGram(long u, int scale, RoundingMode roundingMode)
public BigDecimal toGram(BigDecimal u)
public abstract BigDecimal toGram(BigDecimal u, int scale, RoundingMode roundingMode)
u
- unitscale
- scaleroundingMode
- roundingModepublic BigDecimal toKilogram(long u)
public BigDecimal toKilogram(long u, int scale, RoundingMode roundingMode)
public BigDecimal toKilogram(BigDecimal u)
public abstract BigDecimal toKilogram(BigDecimal u, int scale, RoundingMode roundingMode)
u
- unitscale
- scaleroundingMode
- roundingModepublic BigDecimal toTon(long u)
public BigDecimal toTon(long u, int scale, RoundingMode roundingMode)
public BigDecimal toTon(BigDecimal u)
public abstract BigDecimal toTon(BigDecimal u, int scale, RoundingMode roundingMode)
u
- unitscale
- scaleroundingMode
- roundingModeCopyright © 2024. All rights reserved.