Fixed problem with not specifying decimal precidence

pull/10/head
David Hall 2018-07-21 14:13:09 -06:00
parent d6bce2e752
commit 4795240bdc
1 changed files with 1 additions and 1 deletions

View File

@ -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](?<prec>\\d+)$");
var m = System.Text.RegularExpressions.Regex.Match(format, @"^[B|b](?<prec>\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)));