1
0
mirror of synced 2024-11-23 20:10:57 +01:00
TaikoSoundEditor/Commons/Utils/Number.cs
2023-10-01 19:40:41 +03:00

32 lines
734 B
C#

using System;
namespace TaikoSoundEditor.Commons.Utils
{
internal static class Number
{
public static int ParseInt(string value)
{
try
{
return int.Parse(value);
}
catch(FormatException ex)
{
throw new FormatException($"{ex.Message} : '{value ?? "<null>"}' to int", ex);
}
}
public static float ParseFloat(string value)
{
try
{
return float.Parse(value);
}
catch (FormatException ex)
{
throw new FormatException($"{ex.Message} : {value} to float", ex);
}
}
}
}