We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c6103a commit 4fbae45Copy full SHA for 4fbae45
src/Synercoding.Primitives/Extensions/ValueExtensions.cs
@@ -0,0 +1,20 @@
1
+namespace Synercoding.Primitives.Extensions
2
+{
3
+ /// <summary>
4
+ /// Extension methods for <see cref="Value"/>
5
+ /// </summary>
6
+ public static class ValueExtensions
7
+ {
8
9
+ /// Get a double representing a value in a given unit
10
11
+ /// <param name="value">The value to get the raw number for</param>
12
+ /// <param name="unit">The unit of the returned raw value</param>
13
+ /// <returns>A double representing the value</returns>
14
+ /// <remarks>
15
+ /// Shorthand for <c>value.ConvertTo(unit).Raw</c>
16
+ /// </remarks>
17
+ public static double AsRaw(this Value value, Unit unit)
18
+ => value.ConvertTo(unit).Raw;
19
+ }
20
+}
0 commit comments