<commit_before>﻿using Discord;
using Discord.Commands;
using NadekoBot.Common.Attributes;
using NadekoBot.Core.Common;
using NadekoBot.Extensions;
using NadekoBot.Modules.Utility.Services;
using System;
using System.Linq;
using System.Threading.Tasks;

namespace NadekoBot.Modules.Utility
{
    public partial class Utility
    {
        [Group]
        public class UnitConverterCommands : NadekoSubmodule<ConverterService>
        {
            [NadekoCommand, Usage, Description, Aliases]
            public async Task ConvertList()
            {
                var units = _service.Units;
                var res = units.GroupBy(x => x.UnitType)
                               .Aggregate(new EmbedBuilder().WithTitle(GetText("convertlist"))
                                                            .WithOkColor(),
                                          (embed, g) => embed.AddField(efb =>
                                                                         efb.WithName(g.Key.ToTitleCase())
                                                                         .WithValue(String.Join(", ", g.Select(x => x.Triggers.FirstOrDefault())
                                                                                                       .OrderBy(x => x)))));
                await ctx.Channel.EmbedAsync(res).ConfigureAwait(false);
            }

            [NadekoCommand, Usage, Description, Aliases]
            [Priority(1)]
            public Task Convert(string origin, string target, ShmartNumber value)
                => Convert(origin, target, (decimal)value.Value);

            [NadekoCommand, Usage, Description, Aliases]
            [Priority(0)]
            public async Task Convert(string origin, string target, decimal value)<commit_msg>.convert will no longer round input values<commit_after>﻿using Discord;
using Discord.Commands;
using NadekoBot.Common.Attributes;
using NadekoBot.Core.Common;
using NadekoBot.Extensions;
using NadekoBot.Modules.Utility.Services;
using System;
using System.Linq;
using System.Threading.Tasks;

namespace NadekoBot.Modules.Utility
{
    public partial class Utility
    {
        [Group]
        public class UnitConverterCommands : NadekoSubmodule<ConverterService>
        {
            [NadekoCommand, Usage, Description, Aliases]
            public async Task ConvertList()
            {
                var units = _service.Units;
                var res = units.GroupBy(x => x.UnitType)
                               .Aggregate(new EmbedBuilder().WithTitle(GetText("convertlist"))
                                                            .WithOkColor(),
                                          (embed, g) => embed.AddField(efb =>
                                                                         efb.WithName(g.Key.ToTitleCase())
                                                                         .WithValue(String.Join(", ", g.Select(x => x.Triggers.FirstOrDefault())
                                                                                                       .OrderBy(x => x)))));
                await ctx.Channel.EmbedAsync(res).ConfigureAwait(false);
            }

            [NadekoCommand, Usage, Description, Aliases]
            [Priority(0)]
            public async Task Convert(string origin, string target, decimal value)
{'fraction_non_alphanumeric': 0.08669656203288491, 'fraction_numerical': 0.0008968609865470852, 'mean_word_length': 1.371367824238129, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6740075', 'n_tokens_mistral': 750, 'n_tokens_neox': 755, 'n_words': 165}