-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change unit for printing a dimensionless SiScalar to be blank #14
Comments
This now returns a dimensionless SIScalar.
Especially for a dimensionless SIScalar and SIVector. Relates to averbraeck/djunits#14
The code: SIScalar s1 = Torque.of(1.33, "N.m").divide(Energy.valueOf("2.1 J"));
System.out.println("|" + s1 + "|"); now displays:
A demo called |
DIMLESS is defined as the SIUnit with all dimensions equal to zero: SIUnit.of(new SIDimensions(0, 0, 0, 0, 0, 0, 0, 0, 0))
A helper static constant for the SIUnit DIMLESS = SIUnit.of(new SIDimensions(0, 0, 0, 0, 0, 0, 0, 0, 0)); |
The Dimensionless unit and SI quantity for dimensionless now display "" instead of "1" (or even "unit").
All 283 unit tests pass again after the changes of the |
The following changes have been made:
This covers all known issues with dimensionless SI values to not print or use '1' anymore as the unit, but leave it blank in the exact way that |
Currently, a dimensionless
SIScalar
prints a unit of '1'. Now that theDimensionless
prints a blank unit, theSIScalar
has to be changed as well to be consistent. As an example, the following code:prints:
The text was updated successfully, but these errors were encountered: