Skip to content

Commit

Permalink
Update Units.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
burdoto committed Jul 8, 2023
1 parent 5e0a1c2 commit 124d129
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/Units.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public string ToCompoundString(UnitValue it)
if (val >= 1)
{
var here = (int)val * link.unit;
str += $"{here}{link.unit.Identifier}";
str += here.ToString();
it -= here;
}
}
Expand Down Expand Up @@ -533,10 +533,10 @@ public override List<UnitAccumulatorStrategy> Strategies

public static UnitValue operator +(double right, UnitValue left) => left + right;
public static UnitValue operator +(UnitValue left, double right) => left + (left as Unit) * right;
public static UnitValue operator +(UnitValue left, UnitValue right) => (left as Unit) * (left.Value + right.Value); // TODO does not work right when subtracting different fuc stages
public static UnitValue operator +(UnitValue left, UnitValue right) => (left as Unit) * (left.Value + right.Value); // TODO does not work right when subtracting different si prefixes
public static UnitValue operator -(double right, UnitValue left) => left - right;
public static UnitValue operator -(UnitValue left, double right) => left - (left as Unit) * right;
public static UnitValue operator -(UnitValue left, UnitValue right) => (left as Unit) * (left.Value - right.Value); // TODO does not work right when subtracting different fuc stages
public static UnitValue operator -(UnitValue left, UnitValue right) => (left as Unit) * (left.Value - right.Value); // TODO does not work right when subtracting different si prefixes
public static UnitValue operator *(double right, UnitValue l) => l * right;
public static UnitValue operator *(UnitValue l, double right) => l * (Units.EmptyUnit * right);
public static UnitValue operator *(UnitValue l, UnitValue r)
Expand Down

0 comments on commit 124d129

Please sign in to comment.