@@ -43,7 +43,7 @@ public struct {_quantity.Name}
4343 /// <summary>
4444 /// The numeric value this quantity was constructed with.
4545 /// </summary>
46- private readonly { _quantity . ValueType } _value;
46+ private readonly double _value;
4747
4848 /// <summary>
4949 /// The unit this quantity was constructed with.
@@ -53,7 +53,7 @@ public struct {_quantity.Name}
5353 /// <summary>
5454 /// The numeric value this quantity was constructed with.
5555 /// </summary>
56- public { _quantity . ValueType } Value => _value;
56+ public double Value => _value;
5757
5858 /// <inheritdoc />
5959 public { _unitEnumName } Unit => _unit;
@@ -66,7 +66,7 @@ public struct {_quantity.Name}
6666 /// <param name=""value"">The numeric value to construct this quantity with.</param>
6767 /// <param name=""unit"">The unit representation to construct this quantity with.</param>
6868 /// <exception cref=""ArgumentException"">If value is NaN or Infinity.</exception>
69- public { _quantity . Name } ({ _quantity . ValueType } value, { _unitEnumName } unit)
69+ public { _quantity . Name } (double value, { _unitEnumName } unit)
7070 {{
7171 _value = value;
7272 _unit = unit;
@@ -79,29 +79,14 @@ public struct {_quantity.Name}
7979
8080 /// <summary>
8181 /// Represents the largest possible value of { _quantity . Name } .
82- /// </summary>" ) ;
83-
84- // Non decimal
85- Writer . WLCondition ( _quantity . ValueType != "decimal" , $@ "
86- public static { _quantity . Name } MaxValue {{ get; }} = new { _quantity . Name } ({ _quantity . ValueType } .MaxValue, BaseUnit);
87-
88- /// <summary>
89- /// Represents the smallest possible value of { _quantity . Name } .
9082 /// </summary>
91- public static { _quantity . Name } MinValue {{ get; }} = new { _quantity . Name } ({ _quantity . ValueType } .MinValue, BaseUnit);
92- " ) ;
93-
94- // Decimal MaxValue = 79228162514264337593543950335M
95- Writer . WLCondition ( _quantity . ValueType == "decimal" , $@ "
96- public static { _quantity . Name } MaxValue {{ get; }} = new { _quantity . Name } (79228162514264337593543950335M, BaseUnit);
83+ public static { _quantity . Name } MaxValue {{ get; }} = new { _quantity . Name } (double.MaxValue, BaseUnit);
9784
9885 /// <summary>
9986 /// Represents the smallest possible value of { _quantity . Name } .
10087 /// </summary>
101- public static { _quantity . Name } MinValue {{ get; }} = new { _quantity . Name } (-79228162514264337593543950335M, BaseUnit);
102- " ) ;
88+ public static { _quantity . Name } MinValue {{ get; }} = new { _quantity . Name } (double.MinValue, BaseUnit);
10389
104- Writer . WL ( $@ "
10590 /// <summary>
10691 /// Gets an instance of this quantity with a value of 0 in the base unit Second.
10792 /// </summary>
@@ -134,7 +119,7 @@ private void GenerateConversionProperties()
134119 /// </summary>" ) ;
135120 Writer . WLIfText ( 2 , GetObsoleteAttributeOrNull ( unit ) ) ;
136121 Writer . WL ( $@ "
137- public { _quantity . ValueType } { unit . PluralName } => As({ _unitEnumName } .{ unit . SingularName } );
122+ public double { unit . PluralName } => As({ _unitEnumName } .{ unit . SingularName } );
138123" ) ;
139124 }
140125
@@ -161,7 +146,7 @@ private void GenerateStaticFactoryMethods()
161146 /// <exception cref=""ArgumentException"">If value is NaN or Infinity.</exception>" ) ;
162147 Writer . WLIfText ( 2 , GetObsoleteAttributeOrNull ( unit ) ) ;
163148 Writer . WL ( $@ "
164- public static { _quantity . Name } From{ unit . PluralName } ({ _quantity . ValueType } { valueParamName } ) => new { _quantity . Name } ({ valueParamName } , { _unitEnumName } .{ unit . SingularName } );
149+ public static { _quantity . Name } From{ unit . PluralName } (double { valueParamName } ) => new { _quantity . Name } ({ valueParamName } , { _unitEnumName } .{ unit . SingularName } );
165150" ) ;
166151 }
167152
@@ -172,7 +157,7 @@ private void GenerateStaticFactoryMethods()
172157 /// <param name=""value"">Value to convert from.</param>
173158 /// <param name=""fromUnit"">Unit to convert from.</param>
174159 /// <returns>{ _quantity . Name } unit value.</returns>
175- public static { _quantity . Name } From({ _quantity . ValueType } value, { _unitEnumName } fromUnit)
160+ public static { _quantity . Name } From(double value, { _unitEnumName } fromUnit)
176161 {{
177162 return new { _quantity . Name } (value, fromUnit);
178163 }}
@@ -190,7 +175,7 @@ private void GenerateConversionMethods()
190175 /// Convert to the unit representation <paramref name=""unit"" />.
191176 /// </summary>
192177 /// <returns>Value converted to the specified unit.</returns>
193- public { _quantity . ValueType } As({ _unitEnumName } unit) => GetValueAs(unit);
178+ public double As({ _unitEnumName } unit) => GetValueAs(unit);
194179
195180 /// <summary>
196181 /// Converts this { _quantity . Name } to another { _quantity . Name } with the unit representation <paramref name=""unit"" />.
@@ -207,7 +192,7 @@ private void GenerateConversionMethods()
207192 /// This is typically the first step in converting from one unit to another.
208193 /// </summary>
209194 /// <returns>The value in the base unit representation.</returns>
210- private { _quantity . ValueType } GetValueInBaseUnit()
195+ private double GetValueInBaseUnit()
211196 {{
212197 return Unit switch
213198 {{" ) ;
@@ -223,7 +208,7 @@ private void GenerateConversionMethods()
223208 }};
224209 }}
225210
226- private { _quantity . ValueType } GetValueAs({ _unitEnumName } unit)
211+ private double GetValueAs({ _unitEnumName } unit)
227212 {{
228213 if (Unit == unit)
229214 return _value;
0 commit comments