Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
Added the possibility to convert a proportion to a percentage string (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Jun 4, 2022
1 parent f76822d commit 3a785dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions LeoCorpLibrary/Maths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,8 @@ public static class Percentage
/// <param name="evolutionRate">The evolution rate to get the inverse of.</param>
/// <returns>A <see cref="double"/> value.</returns>
public static double GetInvertedEvolutionRate(double evolutionRate) => 1 / (1 + evolutionRate) - 1;

public static string ProportionToPercentageString(double proportion) => $"{proportion * 100}%";
}
}
}

0 comments on commit 3a785dc

Please sign in to comment.