1
0
mirror of synced 2025-02-17 11:18:33 +01:00

32 lines
734 B
C#
Raw Permalink Normal View History

2023-07-19 08:10:25 +03:00
using System;
2023-10-01 19:40:41 +03:00
namespace TaikoSoundEditor.Commons.Utils
2023-07-19 08:10:25 +03:00
{
internal static class Number
{
public static int ParseInt(string value)
{
try
{
return int.Parse(value);
}
catch(FormatException ex)
{
2023-07-28 18:15:05 +03:00
throw new FormatException($"{ex.Message} : '{value ?? "<null>"}' to int", ex);
2023-07-19 08:10:25 +03:00
}
}
public static float ParseFloat(string value)
{
try
{
return float.Parse(value);
}
catch (FormatException ex)
{
throw new FormatException($"{ex.Message} : {value} to float", ex);
}
}
}
}