<commit_before>﻿using Windows.UI.Xaml;

namespace CryptoTracker.Helpers {
    static class Converters {
        public static Visibility InvertVisibility(Visibility value) => value == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
    }
}<commit_msg>new Converters<commit_after>﻿using Windows.UI.Xaml;
using System;
using Windows.UI.Xaml.Data;
using System.Globalization;

namespace CryptoTracker.Helpers {
    static class Converters {
        public static Visibility InvertVisibility(Visibility value) => value == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;

        public static string ShortenDateTime(DateTime date) => date.ToShortDateString();


        public static string ThousandSeparator(string number) => string.Format((string)number);

        public static string ToKMB(double num) {
            if (num > 999999999) {
                return num.ToString("0,,,.##B", CultureInfo.InvariantCulture);
            }
            else
            if (num > 999999) {
                return num.ToString("0,,.##M", CultureInfo.InvariantCulture);
            }
            else
            if (num > 999) {
                num = Math.Round(num, 2);
                return num.ToString(CultureInfo.InvariantCulture);
            }
            else {
                num = Math.Round(num, 3);
                return num.ToString(CultureInfo.InvariantCulture);
            }
        }
    }

    public class StringFormatConverter : IValueConverter {
        public object Convert(object value, Type targetType, object parameter, string language) {
            try {
                var str = value.ToString();
                var num = double.Parse(str);
                if (!String.IsNullOrEmpty(str))
                    return num.ToString("N0", CultureInfo.CurrentCulture.NumberFormat);

                return value;
            }
            catch {
                return value;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language) {
            throw new NotImplementedException();
        }
    }
}
{'fraction_non_alphanumeric': 0.09146628948609146, 'fraction_numerical': 0.010843941537010843, 'mean_word_length': 2.0401146131805157, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '651382', 'n_tokens_mistral': 552, 'n_tokens_neox': 517, 'n_words': 128}