Skip to content
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

Add quantity CloudCover #883

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions Common/UnitDefinitions/CloudCover.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"Name": "CloudCover",
"BaseUnit": "Fraction",
"XmlDoc": "Cloud cover (also known as cloudiness, cloudage, or cloud amount) refers to the fraction of the sky obscured by clouds when observed from a particular location.",
"Units": [
{
"SingularName": "Okta",
"PluralName": "Oktas",
"FromUnitToBaseFunc": "x * 0.125",
"FromBaseToUnitFunc": "System.Math.Round(x / 0.125, MidpointRounding.AwayFromZero)",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "oktas" ]
}
]
},
{
"SingularName": "Percent",
"PluralName": "Percent",
"FromUnitToBaseFunc": "x/1e2",
"FromBaseToUnitFunc": "x*1e2",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "%" ]
}
]
},
{
"SingularName": "Fraction",
"PluralName": "Fractions",
"FromUnitToBaseFunc": "x",
"FromBaseToUnitFunc": "x",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "" ]
}
]
}
]
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions UnitsNet.Tests/CustomCode/CloudCoverTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by \generate-code.bat.
//
// Changes to this file will be lost when the code is regenerated.
// The build server regenerates the code before each build and a pre-build
// step will regenerate the code on each local build.
//
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
//
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
//
// </auto-generated>
//------------------------------------------------------------------------------

// Licensed under MIT No Attribution, see LICENSE file at the root.
// Copyright 2013 Andreas Gullberg Larsen ([email protected]). Maintained at https://github.com/angularsen/UnitsNet.

using System;

namespace UnitsNet.Tests.CustomCode
{
public class CloudCoverTests : CloudCoverTestsBase
{
protected override double FractionsInOneFraction => 1;
protected override double FractionsTolerance => base.FractionsTolerance;
protected override double OktasInOneFraction => 8;
protected override double OktasTolerance => base.OktasTolerance;
protected override double PercentInOneFraction => 1e2;
protected override double PercentTolerance => base.PercentTolerance;
protected override bool SupportsSIUnitSystem => false;
}
}
4 changes: 4 additions & 0 deletions UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading