Skip to content

Commit

Permalink
minor edits and typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrowder committed Feb 4, 2020
1 parent 305ee67 commit 603cb75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ name found in the *Perl Cookbook*.

## LICENSE

Artistic 2.0. See [LICENSE](https://github.com/tbrowder/Text-Utils-Raku/blob/master/LICENSE).
Artistic 2.0. See that license [here](./LICENSE).

## COPYRIGHT

Expand Down
6 changes: 3 additions & 3 deletions lib/Text/Utils.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ multi strip-comment($line is copy, #= string of text with possible comment
} # strip-comment

#-----------------------------------------------------------------------
#| Purpose : Add commas to a mumber to separate multiples of a thousand
#| Purpose : Add commas to a number to separate multiples of a thousand
#| Params : An integer or number with a decimal fraction
#| Returns : The input number with commas added, e.g.,
#| 1234.56 => 1,234.56
Expand All @@ -109,8 +109,8 @@ sub commify($num) is export(:commify) {
say "DEBUG: input '$num'" if $DEBUG;
my $text = $num.flip;
say "DEBUG: input flipped '$text'" if $DEBUG;
#$text =~ s:g/ (\d\d\d)(?=\d)(?!\d*\.)/$0,/; # how to do in Perl 6?

#$text =~ s:g/ (\d\d\d)(?=\d)(?!\d*\.)/$0,/; # Perl
# in Raku:
$text ~~ s:g/ (\d\d\d) <?before \d> <!before \d*\.> /$0,/;
# don't forget to flip back to the original
Expand Down

0 comments on commit 603cb75

Please sign in to comment.