Search in sources :

Example 1 with TransformedUnit

use of tech.units.indriya.unit.TransformedUnit in project indriya by unitsofmeasurement.

the class EBNFFormatTest 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);
}
Also used : Length(javax.measure.quantity.Length) RationalConverter(tech.units.indriya.function.RationalConverter) TransformedUnit(tech.units.indriya.unit.TransformedUnit) Test(org.junit.jupiter.api.Test)

Example 2 with TransformedUnit

use of tech.units.indriya.unit.TransformedUnit 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);
}
Also used : Length(javax.measure.quantity.Length) RationalConverter(tech.units.indriya.function.RationalConverter) TransformedUnit(tech.units.indriya.unit.TransformedUnit) Test(org.junit.jupiter.api.Test)

Aggregations

Length (javax.measure.quantity.Length)2 Test (org.junit.jupiter.api.Test)2 RationalConverter (tech.units.indriya.function.RationalConverter)2 TransformedUnit (tech.units.indriya.unit.TransformedUnit)2