Skip to content

Commit 7c92510

Browse files
committed
scripts: Support GenerateArithmetic: bool prop
Defaults to true if not set (backwards compatible). Set to false to not generate default arithmetic for a unit class, such as Temperature that must have custom arithmetic.
1 parent 9966cad commit 7c92510

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

UnitsNet/Scripts/Include-GenerateUnitClassSourceCode.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ namespace UnitsNet
275275
# Call another script function to generate logarithm-specific arithmetic operator code.
276276
GenerateLogarithmicArithmeticOperators -className $className -baseUnitFieldName $baseUnitFieldName -baseType $baseType -scalingFactor $unitClass.LogarithmicScalingFactor
277277
}
278-
else {@"
278+
elseif ($unitClass.GenerateArithmetic -eq $true) {@"
279279
280280
#region Arithmetic Operators
281281

0 commit comments

Comments
 (0)