use of tech.units.indriya.function.RationalConverter in project indriya by unitsofmeasurement.
the class SimpleFormatTest method testTransformed.
@Test
public void testTransformed() {
final String ANGSTROEM_SYM = "\u212B";
final Unit<Length> ANGSTROEM = new TransformedUnit<Length>(ANGSTROEM_SYM, METRE, METRE, new RationalConverter(BigInteger.ONE, BigInteger.TEN.pow(10)));
final String s = format.format(ANGSTROEM);
assertEquals(ANGSTROEM_SYM, s);
}
use of tech.units.indriya.function.RationalConverter in project indriya by unitsofmeasurement.
the class PrefixTest method testMebi.
@Test
public void testMebi() {
final UnitConverter expected = new RationalConverter(8, 15625);
final UnitConverter actual = MEBI(METRE).getConverterTo(MEGA(METRE));
assertEquals(expected, actual);
}
use of tech.units.indriya.function.RationalConverter in project indriya by unitsofmeasurement.
the class PrefixTest method testTebi.
@Test
public void testTebi() {
final UnitConverter expected = new RationalConverter(1, 3906250000l);
final UnitConverter actual = TEBI(LITRE).getConverterTo(TERA(LITRE));
assertEquals(expected, actual);
}
use of tech.units.indriya.function.RationalConverter in project indriya by unitsofmeasurement.
the class PrefixTest method testGibi.
@Test
public void testGibi() {
final UnitConverter expected = new RationalConverter(2, 5859375);
final UnitConverter actual = GIBI(METRE).getConverterTo(GIGA(METRE));
assertEquals(expected, actual);
}
use of tech.units.indriya.function.RationalConverter in project indriya by unitsofmeasurement.
the class PrefixTest method testPebi.
@Test
public void testPebi() {
final UnitConverter expected = new RationalConverter(1, 4882812500000L);
final UnitConverter actual = PEBI(LITRE).getConverterTo(PETA(LITRE));
assertEquals(expected, actual);
}
Aggregations