format +/- infinity
This commit is contained in:
@@ -1179,6 +1179,10 @@ namespace FlaxEditor.Utilities
|
|||||||
/// <returns>the formatted string</returns>
|
/// <returns>the formatted string</returns>
|
||||||
public static string FormatFloat(float value, FlaxEngine.Utils.ValueCategory category)
|
public static string FormatFloat(float value, FlaxEngine.Utils.ValueCategory category)
|
||||||
{
|
{
|
||||||
|
if (float.IsPositiveInfinity(value) || value == float.MaxValue)
|
||||||
|
return "Infinity";
|
||||||
|
if (float.IsNegativeInfinity(value) || value == float.MinValue)
|
||||||
|
return "-Infinity";
|
||||||
const string format = "g7";
|
const string format = "g7";
|
||||||
if (!Units.UseUnitsFormatting)
|
if (!Units.UseUnitsFormatting)
|
||||||
return FormatFloat(value);
|
return FormatFloat(value);
|
||||||
@@ -1218,6 +1222,10 @@ namespace FlaxEditor.Utilities
|
|||||||
/// <returns>the formatted string</returns>
|
/// <returns>the formatted string</returns>
|
||||||
public static string FormatFloat(double value, FlaxEngine.Utils.ValueCategory category)
|
public static string FormatFloat(double value, FlaxEngine.Utils.ValueCategory category)
|
||||||
{
|
{
|
||||||
|
if (double.IsPositiveInfinity(value) || value == double.MaxValue)
|
||||||
|
return "Infinity";
|
||||||
|
if (double.IsNegativeInfinity(value) || value == double.MinValue)
|
||||||
|
return "-Infinity";
|
||||||
const string format = "g15";
|
const string format = "g15";
|
||||||
if (!Units.UseUnitsFormatting)
|
if (!Units.UseUnitsFormatting)
|
||||||
return FormatFloat(value);
|
return FormatFloat(value);
|
||||||
|
|||||||
Reference in New Issue
Block a user