Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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": "UnitsNetMath.Clamp(System.Math.Round(x / 0.125, MidpointRounding.AwayFromZero),0,8)",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "oktas" ]
}
]
},
{
"SingularName": "Percent",
"PluralName": "Percent",
"FromUnitToBaseFunc": "UnitsNetMath.Clamp(x/1e2,0,1)",
"FromBaseToUnitFunc": "UnitsNetMath.Clamp(x*1e2,0,1e2)",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "%" ]
}
]
},
{
"SingularName": "Fraction",
"PluralName": "Fractions",
"FromUnitToBaseFunc": "UnitsNetMath.Clamp(x,0,1)",
"FromBaseToUnitFunc": "UnitsNetMath.Clamp(x,0,1)",
"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.

31 changes: 31 additions & 0 deletions UnitsNet.Tests/CustomCode/CloudCoverTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//------------------------------------------------------------------------------
// <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 OktasInOneFraction => 8;
protected override double PercentInOneFraction => 1e2;
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