1
0
mirror of synced 2025-02-25 22:38:02 +01:00

36 lines
828 B
C#
Raw Normal View History

2023-07-19 08:10:25 +03:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TaikoSoundEditor.Utils
{
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);
}
}
}
}