public class RealQuantity extends Quantity
example:
new RealQuantity(3.4 ,"ml" );
the real number will be stored as a string and formatted as such:
1.00000 = "1" 1.30000 = "1.3" 1.00001 = "1.00001" 1.000009 = "1.0001" truncated after 5 decimal places
| Constructor and Description |
|---|
RealQuantity(double value,
String unit) |
| Modifier and Type | Method and Description |
|---|---|
static String |
format(double value,
int significantDigits)
Format 1.0 as 1 and 1.2000 as 1.2
|
public RealQuantity(double value,
String unit)
public static String format(double value, int significantDigits)
value - the value to formatsignificantDigits - digits to roundCopyright © 2021. All rights reserved.