<commit_before>﻿#region

using System;

#endregion

namespace Tabster.Utilities
{
    public static class VersionExtensions
    {
        public static string ToShortString(this Version version, bool enforceDecimal = true)
        {
            var versionStr = version.ToString();

            while (versionStr.EndsWith("0") || versionStr.EndsWith("."))
            {
                versionStr = versionStr.Remove(versionStr.Length - 1, 1);
            }

            if (enforceDecimal && !versionStr.Contains("."))
            {
                versionStr = string.Format("{0}.0", version);
            }

            return versionStr;
        }
    }
}<commit_msg>Fixed trailing .0 bug with x.0.0.0 conventions.<commit_after>﻿#region

using System;

#endregion

namespace Tabster.Utilities
{
    public static class VersionExtensions
    {
        public static string ToShortString(this Version version, bool enforceDecimal = true)
        {
            var versionStr = version.ToString();

            while (versionStr.EndsWith("0") || versionStr.EndsWith("."))
            {
                versionStr = versionStr.Remove(versionStr.Length - 1, 1);
            }

            if (enforceDecimal && !versionStr.Contains("."))
            {
                versionStr = string.Format("{0}.0", versionStr);
            }

            return versionStr;
        }
    }
}
{'fraction_non_alphanumeric': 0.10949963741841914, 'fraction_numerical': 0.01015228426395939, 'mean_word_length': 1.8630705394190872, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '4653827', 'n_tokens_mistral': 368, 'n_tokens_neox': 359, 'n_words': 80}