angularsen / UnitsNet

Makes life working with units of measurement just a little bit better.
https://www.nuget.org/packages/UnitsNet/
MIT No Attribution
2.65k stars 382 forks source link

Add LinearDensity.GramPerFoot and prefixes #1392

Closed filusma closed 5 months ago

lipchev commented 5 months ago

Not sure why the build is failing- but regardless, I think that mixing the two unit systems like that is a bad idea.

Also, I can already see that there is a small rounding error being introduced by putting in the ~ result of 1/0.3048. For reference, here is how I've defined the PoundPerFoot in the upcoming PR that fixes these issues:

    {
      "SingularName": "PoundPerFoot",
      "PluralName": "PoundsPerFoot",
      "FromUnitToBaseFunc": "{x} * 0.45359237 / 0.3048",
      "FromBaseToUnitFunc": "{x} * 0.3048 / 0.45359237",
      "Localization": [
        {
          "Culture": "en-US",
          "Abbreviations": [ "lb/ft" ]
        }
      ]
    }
filusma commented 5 months ago

I think that mixing the two unit systems like that is a bad idea.

I expected that one and said as much too my colleague :) In our industry it is used in practice though, that's why we would like to have it added.

angularsen commented 5 months ago

I'm seeing many references to this unit on google, so for me I'm fine adding it.

@filusma Can you improve the precision per @lipchev 's recommendation?