Skip to content

Commit

Permalink
Assert that value to format is non-negative
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasWanke committed Feb 7, 2024
1 parent f34e134 commit 899bb6e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/src/prefix.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum Prefix {
final List<String> prefixes;

String format(int value, {int precision = 2}) {
assert(value >= 0);
assert(precision >= 0);

var size = value.toDouble();
Expand Down

0 comments on commit 899bb6e

Please sign in to comment.