Skip to content

Commit aaf33eb

Browse files
committed
X::Str::Numeric
1 parent 44661e7 commit aaf33eb

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

lib/X/Str/Numeric.pod

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
=begin pod
2+
3+
=TITLE class X::Str::Numeric
4+
5+
class X::Str::Numeric is Exception { }
6+
7+
Error thrown (or wrapped in a C<Failure>) when a a conversion from string to
8+
a number fails.
9+
10+
For example
11+
12+
say +"42 answers"
13+
14+
dies with
15+
16+
Cannot convert string to number: trailing characters after number in '42⏏ answers' (indicated by ⏏)
17+
18+
=head1 Methods
19+
20+
=head2 source
21+
22+
method source() returns Str:D
23+
24+
Returns the string that was attempted to convert to a number
25+
26+
=head2 pos
27+
28+
method pos() returns Int:D
29+
30+
Gives the position into the string where the parsing failed.
31+
32+
=head2 reason
33+
34+
method reason() returns Int:D
35+
36+
Verbal description of the reason why the conversion failed.
37+
38+
=end pod

0 commit comments

Comments
 (0)