RoR2-ChensHelpers

Contains simple and useful helpers for RoR2 mod creators to use. Mainly caters to Chen's mods.

View on GitHub

ChensHelpers

Chen.Helpers.MathHelpers.Percent

Percent.ToDecimal(float, uint) Method

Converts the percentage into a string with control of the precision.

public static string ToDecimal(this float percentage, uint precision);

Parameters

percentage System.Single
Percentage to modify

precision System.UInt32
Precision to be followed

Returns

System.String
Formatted string of the percentage