mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-04 00:34:26 -05:00 
			
		
		
		
	.economy should not overflow so easily anymore, and big numbers look nicer
This commit is contained in:
		@@ -1,4 +1,5 @@
 | 
			
		||||
using NadekoBot.Db.Models;
 | 
			
		||||
using System;
 | 
			
		||||
using NadekoBot.Db.Models;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using Microsoft.EntityFrameworkCore;
 | 
			
		||||
using Discord;
 | 
			
		||||
@@ -168,7 +169,7 @@ VALUES ({userId}, {name}, {discrim}, {avatarId}, {amount}, 0);
 | 
			
		||||
        public static decimal GetTotalCurrency(this DbSet<DiscordUser> users)
 | 
			
		||||
        {
 | 
			
		||||
            return users
 | 
			
		||||
                .Sum(x => x.CurrencyAmount);
 | 
			
		||||
                .Sum((Func<DiscordUser, decimal>)(x => x.CurrencyAmount));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public static decimal GetTopOnePercentCurrency(this DbSet<DiscordUser> users, ulong botId)
 | 
			
		||||
 
 | 
			
		||||
@@ -66,11 +66,11 @@ namespace NadekoBot.Modules.Gambling
 | 
			
		||||
            }
 | 
			
		||||
            var embed = _eb.Create()
 | 
			
		||||
                .WithTitle(GetText(strs.economy_state))
 | 
			
		||||
                .AddField(GetText(strs.currency_owned), ((BigInteger)(ec.Cash - ec.Bot)) + CurrencySign)
 | 
			
		||||
                .AddField(GetText(strs.currency_owned), ((BigInteger)(ec.Cash - ec.Bot)).ToString("N", _enUsCulture) + CurrencySign)
 | 
			
		||||
                .AddField(GetText(strs.currency_one_percent), (onePercent * 100).ToString("F2") + "%")
 | 
			
		||||
                .AddField(GetText(strs.currency_planted), ((BigInteger)ec.Planted) + CurrencySign)
 | 
			
		||||
                .AddField(GetText(strs.owned_waifus_total), ((BigInteger)ec.Waifus) + CurrencySign)
 | 
			
		||||
                .AddField(GetText(strs.bot_currency), ec.Bot + CurrencySign)
 | 
			
		||||
                .AddField(GetText(strs.bot_currency), ec.Bot.ToString("N", _enUsCulture) + CurrencySign)
 | 
			
		||||
                .AddField(GetText(strs.total), ((BigInteger)(ec.Cash + ec.Planted + ec.Waifus)).ToString("N", _enUsCulture) + CurrencySign)
 | 
			
		||||
                .WithOkColor();
 | 
			
		||||
                // ec.Cash already contains ec.Bot as it's the total of all values in the CurrencyAmount column of the DiscordUser table
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user