-
Notifications
You must be signed in to change notification settings - Fork 401
Add quantity CloudCover #883
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
667b30e
Added preliminary CloudCover.json, requesting comments.
MarkCiliaVincenti 1ee0618
first draft
MarkCiliaVincenti 20f3be9
Added NumericExtensions, clamped cloud cover, removed unnecessary ove…
MarkCiliaVincenti c960e62
regenerated code; had to rename NumericExtensions
MarkCiliaVincenti 9ecac36
Duplicated extension method to UnitsNet.WindowsRuntimeComponent
MarkCiliaVincenti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] | ||
MarkCiliaVincenti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
] | ||
}, | ||
{ | ||
"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": [ "" ] | ||
} | ||
] | ||
} | ||
] | ||
} |
40 changes: 40 additions & 0 deletions
40
UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToCloudCoverExtensionsTest.g.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
UnitsNet.NumberExtensions/GeneratedCode/NumberToCloudCoverExtensions.g.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.