From 4795240bdc57fc8d2b6955b1bc8cfb4d2709d195 Mon Sep 17 00:00:00 2001 From: David Hall Date: Sat, 21 Jul 2018 14:13:09 -0600 Subject: [PATCH] Fixed problem with not specifying decimal precidence --- Core/ByteSizeFormatter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/ByteSizeFormatter.cs b/Core/ByteSizeFormatter.cs index 7eade816..2a179d5c 100644 --- a/Core/ByteSizeFormatter.cs +++ b/Core/ByteSizeFormatter.cs @@ -26,7 +26,7 @@ namespace Vanara try { bytes = Convert.ToInt64(arg); } catch { return HandleOtherFormats(format, arg); } if (bytes == 0) return "0" + suffixes[0]; - var m = System.Text.RegularExpressions.Regex.Match(format, "^[B|b](?\\d+)$"); + var m = System.Text.RegularExpressions.Regex.Match(format, @"^[B|b](?\d+)?$"); if (!m.Success) return HandleOtherFormats(format, arg); var prec = m.Groups["prec"].Success ? byte.Parse(m.Groups["prec"].Value) : 0; var place = Convert.ToInt32(Math.Floor(Math.Log(bytes, 1024)));