Skip to content

Commit

Permalink
change order of processing
Browse files Browse the repository at this point in the history
  • Loading branch information
roysurles committed May 4, 2018
1 parent 929ca61 commit 07034c5
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ public static string ToFormattedDecimalString(this decimal? decimalValue, bool a

var resultString = string.Concat(decimalValue.Value.ToString(NumberFormatString), GetWhiteSpace(addSpaceBeforeSuffix));

if (decimalValue >= 1_000)
resultString = string.Concat((decimalValue / 1_000).Value.ToString(NumberFormatString), GetWhiteSpace(addSpaceBeforeSuffix), KiloSuffixString);
if (decimalValue >= 1_000_000_000)
return string.Concat((decimalValue / 1_000_000_000).Value.ToString(NumberFormatString), GetWhiteSpace(addSpaceBeforeSuffix), GigaSuffixString);

if (decimalValue >= 1_000_000)
resultString = string.Concat((decimalValue / 1_000_000).Value.ToString(NumberFormatString), GetWhiteSpace(addSpaceBeforeSuffix), MegaSuffixString);
return string.Concat((decimalValue / 1_000_000).Value.ToString(NumberFormatString), GetWhiteSpace(addSpaceBeforeSuffix), MegaSuffixString);

if (decimalValue >= 1_000_000_000)
resultString = string.Concat((decimalValue / 1_000_000_000).Value.ToString(NumberFormatString), GetWhiteSpace(addSpaceBeforeSuffix), GigaSuffixString);
if (decimalValue >= 1_000)
return string.Concat((decimalValue / 1_000).Value.ToString(NumberFormatString), GetWhiteSpace(addSpaceBeforeSuffix), KiloSuffixString);

return resultString;
}
Expand Down

0 comments on commit 07034c5

Please sign in to comment.