From 899bb6e4f678144d9676a9b6c8659c961f99a860 Mon Sep 17 00:00:00 2001 From: Jonas Wanke Date: Wed, 7 Feb 2024 18:54:58 +0100 Subject: [PATCH] Assert that value to format is non-negative --- lib/src/prefix.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/prefix.dart b/lib/src/prefix.dart index 831bf3e..0750f6b 100644 --- a/lib/src/prefix.dart +++ b/lib/src/prefix.dart @@ -20,6 +20,7 @@ enum Prefix { final List prefixes; String format(int value, {int precision = 2}) { + assert(value >= 0); assert(precision >= 0); var size = value.toDouble();