Package org.djunits.formatter
Class QuantityFormatTest
java.lang.Object
org.djunits.formatter.QuantityFormatTest
Tests all
QuantityFormat settings and their effect on quantity formatting.
Copyright (c) 2026-2026 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djunits.org. The DJUNITS project is distributed under a three-clause BSD-style license.
- Author:
- Alexander Verbraeck
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final voidsetup()Setup correct locale for test.voidTest prefix separator between number and unit, and postfix after the unit for an absolute quantity.voidTest absolute quantity formatting with prefix separator between number and reference, and postfix after the reference.voidTest the setting and resetting of defaults.voidTest prefix separator between number and unit, and postfix after the unit.voidTest formatting as SI.voidTest SIPrefix not applicable to SI units.voidTest SI scaling (e.g., 1200 kg becomes 1.2 Mg).voidTest SI scaling (e.g., 1200 /m becomes 1.2 /mm).voidTest SI scaling (e.g., 1200 /kg becomes 1.2 /g).voidTest SI scaling (e.g., 1200 J becomes 1.2 kJ).
-
Constructor Details
-
QuantityFormatTest
public QuantityFormatTest()
-
-
Method Details
-
setup
@BeforeEach final void setup()Setup correct locale for test. -
testPrefixPostfix
@Test public void testPrefixPostfix()Test prefix separator between number and unit, and postfix after the unit. -
testSiScalingUnit
@Test public void testSiScalingUnit()Test SI scaling (e.g., 1200 J becomes 1.2 kJ). -
testSiScalingKilo
@Test public void testSiScalingKilo()Test SI scaling (e.g., 1200 kg becomes 1.2 Mg). -
testSiScalingPer
@Test public void testSiScalingPer()Test SI scaling (e.g., 1200 /m becomes 1.2 /mm). -
testSiScalingPerKilo
@Test public void testSiScalingPerKilo()Test SI scaling (e.g., 1200 /kg becomes 1.2 /g). -
testSiPrefixToSiUnit
@Test public void testSiPrefixToSiUnit()Test SIPrefix not applicable to SI units. -
testAbsQuantityPrefixPostfix
@Test public void testAbsQuantityPrefixPostfix()Test prefix separator between number and unit, and postfix after the unit for an absolute quantity. -
testAbsReferencePrefixPostfix
@Test public void testAbsReferencePrefixPostfix()Test absolute quantity formatting with prefix separator between number and reference, and postfix after the reference. -
testSiFormatting
@Test public void testSiFormatting()Test formatting as SI. -
testDefaults
@Test public void testDefaults()Test the setting and resetting of defaults.
-