- Most if not all gambling commands should now use locale-specific currency format

- Enabled preview language features
This commit is contained in:
Kwoth
2022-02-03 13:51:50 +01:00
parent eecccc8100
commit f77f2f433f
14 changed files with 72 additions and 56 deletions

View File

@@ -1,5 +1,7 @@
#nullable disable
using NadekoBot.Modules.Gambling.Services;
using System.Globalization;
using System.Runtime;
namespace NadekoBot.Modules.Gambling.Common;
@@ -37,6 +39,14 @@ public abstract class GamblingModule<TService> : NadekoModule<TService>
return true;
}
protected string N<T>(T cur) where T : INumber<T>
{
var flowersCi = (CultureInfo)Culture.Clone();
flowersCi.NumberFormat.CurrencySymbol = CurrencySign;
flowersCi.NumberFormat.CurrencyNegativePattern = 5;
return cur.ToString("C0", flowersCi);
}
protected Task<bool> CheckBetMandatory(long amount)
{