Format a float value either as-is, with a distance unit or with a degree sign. The value to format. The value type: none means just a number, distance will format in cm/m/km, angle with an appended degree sign. The formatted string.
(float value, FlaxEngine.Utils.ValueCategory category)
| 1051 | /// <param name="category">The value type: none means just a number, distance will format in cm/m/km, angle with an appended degree sign.</param> |
| 1052 | /// <returns>The formatted string.</returns> |
| 1053 | public static string FormatFloat(float value, FlaxEngine.Utils.ValueCategory category) |
| 1054 | { |
| 1055 | if (float.IsPositiveInfinity(value) || value == float.MaxValue) |
| 1056 | return "Infinity"; |
| 1057 | if (float.IsNegativeInfinity(value) || value == float.MinValue) |
| 1058 | return "-Infinity"; |
| 1059 | if (!Units.UseUnitsFormatting || category == FlaxEngine.Utils.ValueCategory.None) |
| 1060 | return FormatFloat(value); |
| 1061 | const string format = "G7"; |
| 1062 | return InternalFormat(value, format, category); |
| 1063 | } |
| 1064 | |
| 1065 | /// <summary> |
| 1066 | /// Format a double value either as-is, with a distance unit or with a degree sign |