@@ -73,7 +73,7 @@ namespace UnitsNet
7373 /// The numeric value this quantity was constructed with.
7474 /// </summary>
7575 [DataMember(Name = ""Value"", Order = 1, EmitDefaultValue = false)]
76- private readonly QuantityValue _value;
76+ private readonly double _value;
7777
7878 /// <summary>
7979 /// The unit this quantity was constructed with.
@@ -125,7 +125,7 @@ private void GenerateInterfaceExtensions()
125125 if ( ! _quantity . IsAffine )
126126 {
127127 Writer . WL ( $@ "
128- IDivisionOperators<{ _quantity . Name } , { _quantity . Name } , QuantityValue >," ) ;
128+ IDivisionOperators<{ _quantity . Name } , { _quantity . Name } , double >," ) ;
129129 }
130130
131131 if ( _quantity . Relations . Any ( r => r . Operator is "*" or "/" ) )
@@ -308,7 +308,7 @@ private void GenerateInstanceConstructors()
308308 /// </summary>
309309 /// <param name=""value"">The numeric value to construct this quantity with.</param>
310310 /// <param name=""unit"">The unit representation to construct this quantity with.</param>
311- public { _quantity . Name } (QuantityValue value, { _unitEnumName } unit)
311+ public { _quantity . Name } (double value, { _unitEnumName } unit)
312312 {{" ) ;
313313 Writer . WL ( @"
314314 _value = value;" ) ;
@@ -327,7 +327,7 @@ private void GenerateInstanceConstructors()
327327 /// <param name=""unitSystem"">The unit system to create the quantity with.</param>
328328 /// <exception cref=""ArgumentNullException"">The given <see cref=""UnitSystem""/> is null.</exception>
329329 /// <exception cref=""ArgumentException"">No unit was found for the given <see cref=""UnitSystem""/>.</exception>
330- public { _quantity . Name } (QuantityValue value, UnitSystem unitSystem)
330+ public { _quantity . Name } (double value, UnitSystem unitSystem)
331331 {{
332332 _value = value;
333333 _unit = Info.GetDefaultUnit(unitSystem);
@@ -375,7 +375,7 @@ private void GenerateStaticProperties()
375375 {
376376 Writer . WL ( $@ "
377377 /// <inheritdoc />
378- public static QuantityValue LogarithmicScalingFactor {{get;}} = { 10 * _quantity . LogarithmicScalingFactor } ;
378+ public static double LogarithmicScalingFactor {{get;}} = { 10 * _quantity . LogarithmicScalingFactor } ;
379379" ) ;
380380 }
381381
@@ -390,7 +390,7 @@ private void GenerateProperties()
390390 #region Properties
391391
392392 /// <inheritdoc />
393- public QuantityValue Value => _value;
393+ public double Value => _value;
394394
395395 /// <inheritdoc />
396396 public { _unitEnumName } Unit => _unit.GetValueOrDefault(BaseUnit);
@@ -421,7 +421,7 @@ private void GenerateProperties()
421421 {
422422 Writer . WL ( $@ "
423423#if NETSTANDARD2_0
424- QuantityValue ILogarithmicQuantity<{ _quantity . Name } >.LogarithmicScalingFactor => LogarithmicScalingFactor;
424+ double ILogarithmicQuantity<{ _quantity . Name } >.LogarithmicScalingFactor => LogarithmicScalingFactor;
425425#endif
426426" ) ;
427427 }
@@ -444,11 +444,11 @@ private void GenerateConversionProperties()
444444
445445 Writer . WL ( $@ "
446446 /// <summary>
447- /// Gets a <see cref=""QuantityValue ""/> value of this quantity converted into <see cref=""{ _unitEnumName } .{ unit . SingularName } ""/>
447+ /// Gets a <see cref=""double ""/> value of this quantity converted into <see cref=""{ _unitEnumName } .{ unit . SingularName } ""/>
448448 /// </summary>" ) ;
449449 Writer . WLIfText ( 2 , GetObsoleteAttributeOrNull ( unit ) ) ;
450450 Writer . WL ( $@ "
451- public QuantityValue { unit . PluralName } => this.As({ _unitEnumName } .{ unit . SingularName } );
451+ public double { unit . PluralName } => this.As({ _unitEnumName } .{ unit . SingularName } );
452452" ) ;
453453 }
454454
@@ -504,7 +504,7 @@ private void GenerateStaticFactoryMethods()
504504 /// </summary>" ) ;
505505 Writer . WLIfText ( 2 , GetObsoleteAttributeOrNull ( unit ) ) ;
506506 Writer . WL ( $@ "
507- public static { _quantity . Name } From{ unit . PluralName } (QuantityValue value)
507+ public static { _quantity . Name } From{ unit . PluralName } (double value)
508508 {{
509509 return new { _quantity . Name } (value, { _unitEnumName } .{ unit . SingularName } );
510510 }}
@@ -518,7 +518,7 @@ private void GenerateStaticFactoryMethods()
518518 /// <param name=""value"">Value to convert from.</param>
519519 /// <param name=""fromUnit"">Unit to convert from.</param>
520520 /// <returns>{ _quantity . Name } unit value.</returns>
521- public static { _quantity . Name } From(QuantityValue value, { _unitEnumName } fromUnit)
521+ public static { _quantity . Name } From(double value, { _unitEnumName } fromUnit)
522522 {{
523523 return new { _quantity . Name } (value, fromUnit);
524524 }}
@@ -707,25 +707,25 @@ private void GenerateArithmeticOperators()
707707 }}
708708
709709 /// <summary>Get <see cref=""{ _quantity . Name } ""/> from multiplying value and <see cref=""{ _quantity . Name } ""/>.</summary>
710- public static { _quantity . Name } operator *(QuantityValue left, { _quantity . Name } right)
710+ public static { _quantity . Name } operator *(double left, { _quantity . Name } right)
711711 {{
712712 return new { _quantity . Name } (left * right.Value, right.Unit);
713713 }}
714714
715715 /// <summary>Get <see cref=""{ _quantity . Name } ""/> from multiplying value and <see cref=""{ _quantity . Name } ""/>.</summary>
716- public static { _quantity . Name } operator *({ _quantity . Name } left, QuantityValue right)
716+ public static { _quantity . Name } operator *({ _quantity . Name } left, double right)
717717 {{
718718 return new { _quantity . Name } (left.Value * right, left.Unit);
719719 }}
720720
721721 /// <summary>Get <see cref=""{ _quantity . Name } ""/> from dividing <see cref=""{ _quantity . Name } ""/> by value.</summary>
722- public static { _quantity . Name } operator /({ _quantity . Name } left, QuantityValue right)
722+ public static { _quantity . Name } operator /({ _quantity . Name } left, double right)
723723 {{
724724 return new { _quantity . Name } (left.Value / right, left.Unit);
725725 }}
726726
727727 /// <summary>Get ratio value from dividing <see cref=""{ _quantity . Name } ""/> by <see cref=""{ _quantity . Name } ""/>.</summary>
728- public static QuantityValue operator /({ _quantity . Name } left, { _quantity . Name } right)
728+ public static double operator /({ _quantity . Name } left, { _quantity . Name } right)
729729 {{
730730 return left.{ _baseUnit . PluralName } / right.{ _baseUnit . PluralName } ;
731731 }}
@@ -752,7 +752,7 @@ private void GenerateLogarithmicArithmeticOperators()
752752 /// </remarks>
753753 public static { _quantity . Name } operator +({ _quantity . Name } left, { _quantity . Name } right)
754754 {{
755- return new { _quantity . Name } (QuantityValueExtensions.AddWithLogScaling(left.Value, right.As(left.Unit), LogarithmicScalingFactor), left.Unit);
755+ return new { _quantity . Name } ((double) QuantityValueExtensions.AddWithLogScaling((QuantityValue) left.Value, (QuantityValue) right.As(left.Unit), (QuantityValue) LogarithmicScalingFactor), left.Unit);
756756 }}
757757
758758 /// <summary>Get <see cref=""{ _quantity . Name } ""/> from logarithmic subtraction of two <see cref=""{ _quantity . Name } ""/>.</summary>
@@ -761,29 +761,29 @@ private void GenerateLogarithmicArithmeticOperators()
761761 /// </remarks>
762762 public static { _quantity . Name } operator -({ _quantity . Name } left, { _quantity . Name } right)
763763 {{
764- return new { _quantity . Name } (QuantityValueExtensions.SubtractWithLogScaling(left.Value, right.As(left.Unit), LogarithmicScalingFactor), left.Unit);
764+ return new { _quantity . Name } ((double) QuantityValueExtensions.SubtractWithLogScaling((QuantityValue) left.Value, (QuantityValue) right.As(left.Unit), (QuantityValue) LogarithmicScalingFactor), left.Unit);
765765 }}
766766
767767 /// <summary>Get <see cref=""{ _quantity . Name } ""/> from logarithmic multiplication of value and <see cref=""{ _quantity . Name } ""/>.</summary>
768- public static { _quantity . Name } operator *(QuantityValue left, { _quantity . Name } right)
768+ public static { _quantity . Name } operator *(double left, { _quantity . Name } right)
769769 {{
770770 return new { _quantity . Name } (left + right.Value, right.Unit);
771771 }}
772772
773773 /// <summary>Get <see cref=""{ _quantity . Name } ""/> from logarithmic multiplication of value and <see cref=""{ _quantity . Name } ""/>.</summary>
774- public static { _quantity . Name } operator *({ _quantity . Name } left, QuantityValue right)
774+ public static { _quantity . Name } operator *({ _quantity . Name } left, double right)
775775 {{
776776 return new { _quantity . Name } (left.Value + right, left.Unit);
777777 }}
778778
779779 /// <summary>Get <see cref=""{ _quantity . Name } ""/> from logarithmic division of <see cref=""{ _quantity . Name } ""/> by value.</summary>
780- public static { _quantity . Name } operator /({ _quantity . Name } left, QuantityValue right)
780+ public static { _quantity . Name } operator /({ _quantity . Name } left, double right)
781781 {{
782782 return new { _quantity . Name } (left.Value - right, left.Unit);
783783 }}
784784
785785 /// <summary>Get ratio value from logarithmic division of <see cref=""{ _quantity . Name } ""/> by <see cref=""{ _quantity . Name } ""/>.</summary>
786- public static QuantityValue operator /({ _quantity . Name } left, { _quantity . Name } right)
786+ public static double operator /({ _quantity . Name } left, { _quantity . Name } right)
787787 {{
788788 return left.Value - right.As(left.Unit);
789789 }}
@@ -839,7 +839,7 @@ private void GenerateRelationalOperators(bool inverseWithFixedUnit = false)
839839 }
840840 else
841841 {
842- const string valueType = "QuantityValue " ;
842+ const string valueType = "double " ;
843843 var leftParameterType = relation . LeftQuantity . Name ;
844844 var leftConversionProperty = relation . LeftUnit . PluralName ;
845845 var rightParameterType = relation . RightQuantity . Name ;
0 commit comments