v6 Release · Issue #1200 · angularsen/UnitsNet · GitHub
Skip to content

v6 Release #1200

Open
Open

Description

@angularsen

This issue serves as a place to discuss what to include in this version, since major version bumps allow us to make breaking changes we think are necessary or worth it.

The wishlist keeps track of the items to include, but items may be added or removed at any time.

As changes are completed, they are added to https://github.com/angularsen/UnitsNet/wiki/Upgrading-from-5.x-to-6.x

Changes

Fixed

Activity

  1. added this to the vNext milestone on Feb 12, 2023
  2. maxreb commented on Mar 21, 2023

    @maxreb

    Add System.Text.Json support #966

  3. angularsen commented on Apr 1, 2023

    @angularsen
    OwnerAuthor

    Decide on a naming and abbreviation convention for imperial/UK units and US units; like gallon, ounces, cup etc.

    It is a bit of a mess right now:
    image image

    image

    LINQPad sample
    void ListUnits(string withPartialName)
    {
        Quantity.Infos
            .SelectMany(i => i.UnitInfos
                .Where(n => n.Name.Contains(withPartialName))
                .Select(u => new 
                { 
                    u.Name, 
                    Abbrev = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(u.Value.GetType(), Convert.ToInt32(u.Value)) 
                }))
            .Dump(withPartialName);
    }
    
    ListUnits("Uk");
    ListUnits("Imperial");
    ListUnits("Us");

    I personally like "UK", since it is shorter and better matches "US".
    Wolfram also uses US gallon and UK gallon.

    Some conventions for imperial gallons:
    https://en.wikipedia.org/wiki/Gallon#:~:text=the%20imperial%20gallon%20(imp%20gal,American%20and%20Caribbean%20countries%3B%20and

    Today the abbreviation convention is gal (U.S.) and gal (imp.).
    Depending on landing on UK or imperial naming, we could go with one of these pairs:

    • US gal and UK gal
    • US gal and imp gal
    • gal (US) and gal (UK)

    We can support multiple of these plus the old ones, but the primary form should be standardized across the different units.

  4. ebfortin commented on Jun 24, 2023

    @ebfortin
    Contributor

    Do not throw ArgumentException on NaN, Inf+ or Inf- or give a way to configure the behavior globally.

    Context:
    #1268 (comment)

  5. MisinformedDNA commented on Sep 12, 2023

    @MisinformedDNA

    I think UnitsNet should be more extensible. Perhaps there could be a base package, but separate NuGet packages for US measurements, Imperial, UK, etc. Alternatively, customizable abbreviations could be a solution. I would never expect me or my users to see "gal (US)" instead of "gal". This would also help the debate here.

    UPDATE:

    Custom abbreviations already exist: UnitAbbreviationsCache.Default.MapUnitToDefaultAbbreviation(HowMuchUnit.Some, "sm");

  6. angularsen commented on Sep 16, 2023

    @angularsen
    OwnerAuthor

    I think UnitsNet should be more extensible.

    Conceptually, I agree.

    Customizable abbreviations is already supported as you found, and we support custom quantities and units with some limited functionality: https://github.com/angularsen/UnitsNet/wiki/Extending-with-Custom-Units

    Splitting up in packages is not so easy though. Things like Torque = Force * Length becomes problematic when types exist in different packages and they can't have circular dependencies. Imperial is even worse, splitting some units of a quantity to different packages. The main problem is static typing, which is also one of the main features of UnitsNet.

    One benefit of splitting up in packages is smaller binary size to only bring in what you need.
    Some prototyping here: #1181

  7. Markussp256 commented on Nov 29, 2023

    @Markussp256

    I was requested to give a list of units with the wrong plural form (see #1330 )

    I checked the .json-file with the speed units and only MetersPerMinute has a wrong plural form, all other Speed units seem to have the correct plural form.

  8. angularsen commented on Jan 6, 2024

    @angularsen
    OwnerAuthor

    @Markussp256

    I was requested to give a list of units with the wrong plural form (see #1330 )

    I checked the .json-file with the speed units and only MetersPerMinute has a wrong plural form, all other Speed units seem to have the correct plural form.

    Some more fixes were made recently in
    #1351

  9. added a commit that references this issue on Mar 1, 2024
  10. 30 remaining items

  11. angularsen commented on Dec 29, 2024

    @angularsen
    OwnerAuthor

    Big fat release on the way out, merged in changes from master.
    Previous release was Aug 23.

    Release UnitsNet/6.0.0-pre013 · angularsen/UnitsNet

    @lipchev

  12. Anthonywolfe commented on Apr 1, 2025

    @Anthonywolfe
    Contributor

    With IQuantity implementing IParsable would it also be desirable to add support for IUtf8SpanParsable?

  13. lipchev commented on Apr 2, 2025

    @lipchev
    Collaborator

    With IQuantity implementing IParsable would it also be desirable to add support for IUtf8SpanParsable?

    In the current implementation the QuantityParser, with its regex and all, is the worst performing class of the whole library. There are also potential problems that need fixing regarding the fall-back culture (see #1443 ), but given how slow we've been moving with the PR reviews lately, and how many of those I've got in the pipeline, I decided to leave it for another day.

    That said, if you want to take a stab at it, I'll have a look- but please have a look at the direction I took in #1507, I think that would be a necessary first step towards a more performant implementation.

  14. Anthonywolfe commented on Apr 2, 2025

    @Anthonywolfe
    Contributor

    In the current implementation the QuantityParser, with its regex and all, is the worst performing class of the whole library. There are also potential problems that need fixing regarding the fall-back culture (see #1443 ), but given how slow we've been moving with the PR reviews lately, and how many of those I've got in the pipeline, I decided to leave it for another day.

    That said, if you want to take a stab at it, I'll have a look- but please have a look at the direction I took in #1507, I think that would be a necessary first step towards a more performant implementation.

    Ah, I probably should of taken a closer look at how the QuantityParser was implemented before asking as I was hoping it would be a easier lift since I mostly wanted it to move/unify some generic parsing logic to all use IUtf8SpanParsable in my code base.

    Still I'll run some profiling on my side of things and see if I can justify some time to put some work into optimizing the QuantityParser.

  15. angularsen commented on Apr 12, 2025

    @angularsen
    OwnerAuthor

    Update wiki regarding IQuantity and sample quantity #1519 (comment)

    I've been reading through the custom units page and the sample quantity does not conform to the up-to-date IQuantity interface.

    1. QuantityType no longer exists,
    2. QuantityInfo has had some breaking changes, relating to QuantityType and UnitInfo,
    3. QuantityValue Value { get; } had replaced double Value { get; },
    4. and bool Equals(IQuantity? other, IQuantity tolerance); has been added to the interface.
  16. changed the title [-]v6 Wishlist[/-] [+]v6 Release[/+] on Apr 19, 2025
  17. MohMehrnia commented on Nov 26, 2025

    @MohMehrnia

    When issue?

  18. angularsen commented on Dec 6, 2025

    @angularsen
    OwnerAuthor

    When ready.
    Mainly waiting on #1544 and then some time to collect feedback.

    A prerelease nuget is out so you can go ahead and use v6 now.

  19. angularsen commented on Jun 11, 2026

    @angularsen
    OwnerAuthor

    .NET nanoFramework support removed in v6

    As of #1676 (closes #1647), the in-repo .NET nanoFramework projects, code generation, build steps and CI/pipeline tasks have been removed.

    nanoFramework support is now maintained and published by the nanoFramework team in their own repository, with their own NuGet packages:

    Migration for nanoFramework users: replace the old UnitsNet.nanoFramework.* packages with the new nanoFramework.UnitsNet.* packages. The previous packages published from this repo are deprecated.

  20. angularsen commented on Aug 1, 2026

    @angularsen
    OwnerAuthor

    Tracked in #1721 as a behavioral breaking change for v6.

    This consolidates the quantity-format cleanup:

    • A/An duplicates the explicit generated GetAbbreviation() APIs and UnitAbbreviationsCache, including localized and runtime-configured abbreviations.
    • Remove unnecessary format strings #797 intended to remove S, but commit 721287d removed only its documentation and tests; the v5 formatter implementation still supports it. This PR completes that cleanup. The QuantityFormatter defaults to the "G" format #1450 discussion also questioned retaining a formatter that can hide precision. Callers can state their intent with standard/custom numeric formats such as G3, F2, N2, E2, or 0.##.
    • U, V, and Q were already removed during the v6 redesign and are now documented together with A and S as one migration.

    Adding StringSyntaxAttribute.NumericFormat to the public formatting surfaces makes the supported contract explicit and enables IDE format-string assistance. The v6 upgrade guide and string-formatting documentation contain the complete replacement table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pinnedIssues that should not be auto-closed due to inactivity.

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions