Class QuantityFormatTest

java.lang.Object
org.djunits.formatter.QuantityFormatTest

public class QuantityFormatTest extends Object
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 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.