Suffixation of decimal numbers: Difference between revisions

Content added Content deleted
m (→‎{{header|Perl 6}}: remove stray commas)
m (→‎{{header|Perl 6}}: no need for multis, leftover from early experiments)
Line 131: Line 131:
If you desire the number to be rounded, pass in a number representing the placed past the decimal to round to. If you pass in a negative number for rounding, it will round to a negative number of places past the decimal.
If you desire the number to be rounded, pass in a number representing the placed past the decimal to round to. If you pass in a negative number for rounding, it will round to a negative number of places past the decimal.


<lang perl6>multi sufficate ($val is copy, $type is copy = 'M', $round is copy = Any) {
<lang perl6>sub sufficate ($val is copy, $type is copy = 'M', $round is copy = Any) {
if +$type ~~ Int { $round = $type; $type = 'M' }
if +$type ~~ Int { $round = $type; $type = 'M' }
my $s = '';
my $s = '';