Skip to content

Commit

Permalink
lib/Unicode/UCD.pm: update num() usage example
Browse files Browse the repository at this point in the history
A combination of two Rumi digits is not considered a valid decimal
number by num() thus resulting in an undef result value. While such
behaviour is properly documented in the num() description and thus
expected, it might be better to give an example that returns a proper
numeric value.

An equivalent change was made to an example in pod/perlunicook.pod.
  • Loading branch information
vaitkus authored and khwilliamson committed Feb 16, 2025
1 parent 15cbd20 commit c34c211
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charclass_invlists.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/Unicode/UCD.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use warnings;
no warnings 'surrogate'; # surrogates can be inputs to this
use charnames ();

our $VERSION = '0.78';
our $VERSION = '0.79';

sub DEBUG () { 0 }
$|=1 if DEBUG;
Expand Down Expand Up @@ -113,7 +113,7 @@ Unicode::UCD - Unicode character database
my $unicode_version = Unicode::UCD::UnicodeVersion();
my $convert_to_numeric =
Unicode::UCD::num("\N{RUMI DIGIT ONE}\N{RUMI DIGIT TWO}");
Unicode::UCD::num("\N{VAI DIGIT ONE}\N{VAI DIGIT TWO}");
=head1 DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion lib/unicore/uni_keywords.pl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pod/perlunicook.pod
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@ convert such strings manually.
say "@nums"; # 12 4567 0.875 1000000000000

use charnames qw(:full);
my $nv = num("\N{RUMI DIGIT ONE}\N{RUMI DIGIT TWO}");
my $nv = num("\N{VAI DIGIT ONE}\N{VAI DIGIT TWO}");
say $nv; # 12

=head2 ℞ 29: Match Unicode grapheme cluster in regex

Expand Down
6 changes: 3 additions & 3 deletions regcharclass.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions uni_keywords.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c34c211

Please sign in to comment.