forked from angularsen/UnitsNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumberToMagnetizationExtensions.g.cs
More file actions
55 lines (49 loc) · 1.79 KB
/
NumberToMagnetizationExtensions.g.cs
File metadata and controls
55 lines (49 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//------------------------------------------------------------------------------
// <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 (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
using System;
#if NET7_0_OR_GREATER
using System.Numerics;
#endif
#nullable enable
namespace UnitsNet.NumberExtensions.NumberToMagnetization
{
/// <summary>
/// A number to Magnetization Extensions
/// </summary>
public static class NumberToMagnetizationExtensions
{
#pragma warning disable CS1591
extension<T>(T value)
#pragma warning restore CS1591
where T : notnull
#if NET7_0_OR_GREATER
, INumber<T>
#else
, IConvertible
#endif
{
/// <inheritdoc cref="Magnetization.FromAmperesPerMeter(double)" />
public Magnetization AmperesPerMeter
#if NET7_0_OR_GREATER
=> Magnetization.FromAmperesPerMeter(double.CreateChecked(value));
#else
=> Magnetization.FromAmperesPerMeter(value.ToDouble(null));
#endif
}
}
}