From d961402803b546662813141169e70968dde6ddaf Mon Sep 17 00:00:00 2001 From: Moritz Date: Thu, 20 Jul 2023 11:03:33 +0200 Subject: [PATCH] fix readme example --- pkgs/intl4x/README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/intl4x/README.md b/pkgs/intl4x/README.md index 047a70fa..b94a3d0d 100644 --- a/pkgs/intl4x/README.md +++ b/pkgs/intl4x/README.md @@ -36,10 +36,12 @@ import 'package:intl4x/ecma_policy.dart'; import 'package:intl4x/intl4x.dart'; import 'package:intl4x/number_format.dart'; -final numberFormat = Intl( - ecmaPolicy: const AlwaysEcma(), - defaultLocale: Locale(language: 'en', country: 'US'), -).numberFormat(NumberFormatOptions.percent()); - -print(numberFormat.format(0.5)); // prints 50% +void main() { + final numberFormat = Intl( + ecmaPolicy: const AlwaysEcma(), + locale: const Locale(language: 'en', region: 'US'), + ).numberFormat(NumberFormatOptions.percent()); + + print(numberFormat.format(0.5)); // prints 50% +} ```