angularsen / UnitsNet

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

Volume from Mass / Density operator missing. #283

Closed ThomasN-Saab closed 7 years ago

ThomasN-Saab commented 7 years ago

I believe it should look something like the code snippet below and be placed in UnitsNet/CustomCode/UnitClasses/Mass.extra.cs I'd like to leave actually putting it in the project to someone more involved with the development and also more experienced with GitHub than myself.

public static Volume operator/(Mass mass, Density density)
{
    return Volume.FromCubicMeters(mass.Kilograms / density.KilogramsPerCubicMeter);
}
angularsen commented 7 years ago

Hi, you are absolutely correct about the code snippet and where to put it. Would you mind doing a pull request? I really prefer if the person with the idea adds it.

ThomasN-Saab commented 7 years ago

I didn't want to do it because I'm not very familiar with GitHub and I haven't forked a project before. I've done it now though and made the pull request. I guess this was a nice learning experience.

angularsen commented 7 years ago

Fixed by #284