Class Formatters
Provides utility methods for formatting values.
Inheritance
System.Object
Formatters
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: UniUtils.Data
Assembly: cs.temp.dll.dll
Syntax
public static class Formatters
Methods
FormatDoubleToUsdString(Double)
Formats a double value to a USD currency string.
Declaration
public static string FormatDoubleToUsdString(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The double value to format. |
Returns
Type | Description |
---|---|
System.String | A formatted USD currency string. |
Examples
double price = 49.99;
string formatted = Formatters.FormatDoubleToUsdString(price);
Debug.Log(formatted); // Output: "$49.99"
FormatFloatToTimeString(Single)
Formats a float value representing time in seconds to a string in the format "MM:SS:FF".
Declaration
public static string FormatFloatToTimeString(float time)
Parameters
Type | Name | Description |
---|---|---|
System.Single | time | The time value in seconds. |
Returns
Type | Description |
---|---|
System.String | A formatted time string in the format "MM:SS:FF". |
Examples
float playTime = 125.37f; // 2 minutes, 5 seconds, 370 milliseconds
string formatted = Formatters.FormatFloatToTimeString(playTime);
Debug.Log(formatted); // Output: "02:05:37"