diff --git a/CHANGELOG.md b/CHANGELOG.md index 48dba14..05d57ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ +## 0.2.1 + +- Added missing documentation on new feature + ## 0.2.0 - Added support for creating a `Cardinal()` from a cardinal text, e.g., `Cardinal('one thousand')` diff --git a/README.md b/README.md index 9ac9660..c38fd01 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,12 @@ Simple package to transform numbers into English numerals without flutter depend ## Features -Only integer cardinals are currently available, in the non-inclusive range ]-10^66, 10^66[ +Only integer cardinals are currently available, in the non-inclusive range `]-10^66, 10^66[` ## Usage +It can be used to create a `Cardinal` number from `int` or `BigInt`: ```dart final other = Cardinal(999); @@ -27,3 +28,13 @@ print(other.enUk); // "nine hundred and ninety-nine" print(other.enUs); // "nine hundred ninety-nine" print(other.toString()); // "nine hundred ninety-nine" ``` + +It can also be used the other way around to convert cardinal text to int and BigInt: + +```dart +final uk = Cardinal("nine hundred and ninety-nine"); +print(uk.toInt()); // "999" +final us = Cardinal("nine hundred ninety-nine"); +print(us.toInt()); // "999" +``` + \ No newline at end of file diff --git a/example/english_numerals_example.dart b/example/english_numerals_example.dart index 962f63d..0ff0fd7 100644 --- a/example/english_numerals_example.dart +++ b/example/english_numerals_example.dart @@ -12,4 +12,9 @@ void main() { print(other.enUk); // "nine hundred and ninety-nine" print(other.enUs); // "nine hundred ninety-nine" print(other); // "nine hundred ninety-nine" + + final uk = Cardinal('nine hundred and ninety-nine'); + print(uk.toInt()); // "999" + final us = Cardinal('nine hundred ninety-nine'); + print(us.toInt()); // "999" } diff --git a/pubspec.yaml b/pubspec.yaml index 9816eab..5741df5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: english_numerals description: A package to convert numbers to and from their English written form, with null safety and no dependency on flutter. -version: 0.2.0 +version: 0.2.1 homepage: https://github.com/gbassisp/english_numerals environment: