Skip to content

Commit

Permalink
refine PrintMass
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanKell committed Oct 24, 2023
1 parent e371984 commit 3da2a29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/ResourceUnitInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public static ResourceUnitInfo GetResourceUnitInfo(int id)
return info;
}

public static string PrintMass(double mass)
public static string PrintMass(double mass, int sigFigs = 3, bool longPrefix = false)
{
return mass < 1d ? KSPUtil.PrintSI(mass * 1000d * 1000d, "g") : KSPUtil.PrintSI(mass, "t");
return mass < 1d ? KSPUtil.PrintSI(mass * 1000d * 1000d, longPrefix ? "grams" : "g", sigFigs, longPrefix) : KSPUtil.PrintSI(mass, longPrefix ? "tons" : "t", sigFigs, longPrefix);
}

public static string PrintRatePerSecBare(double rate, int resID, int sigFigs = 3, string precision = "G2", bool longPrefix = false)
Expand Down

0 comments on commit 3da2a29

Please sign in to comment.