Aion-Format

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


See also:

* `Roman` is simple converter.
* `Math::Roman` is another converter.
* `Convert::Number::Roman` is OOP interface.
* `Number::Convert::Roman` is another OOP interface.
* `Text::Roman` convert standart and milhar roman numbers.
* `Roman::Unicode` use digits ↁ (5 000), ↂ (1000), and so on.
* `Acme::Roman` added support roman numerals in perl code (`I + II -> III`), but use `+`, `-` and `*` operations only.
* `Date::Roman` is Perl OO extension for handling roman style dates, but with arabic numbers (id 3 702).
* `DateTime::Format::Roman` is roman date formatter, but with arabic numbers (5 Kal Jun 2003).

## round ($number, $decimal)

Rounds a number to the specified decimal place.

```perl
round 1.234567, 2  # -> 1.23
round 1.235567, 2  # -> 1.24
```

lib/Aion/Format.md  view on Meta::CPAN


See also:

* `Roman` is simple converter.
* `Math::Roman` is another converter.
* `Convert::Number::Roman` is OOP interface.
* `Number::Convert::Roman` is another OOP interface.
* `Text::Roman` convert standart and milhar roman numbers.
* `Roman::Unicode` use digits ↁ (5 000), ↂ (1000), and so on.
* `Acme::Roman` added support roman numerals in perl code (`I + II -> III`), but use `+`, `-` and `*` operations only.
* `Date::Roman` is Perl OO extension for handling roman style dates, but with arabic numbers (id 3 702).
* `DateTime::Format::Roman` is roman date formatter, but with arabic numbers (5 Kal Jun 2003).

## round ($number, $decimal)

Rounds a number to the specified decimal place.

```perl
round 1.234567, 2  # -> 1.23
round 1.235567, 2  # -> 1.24
```

lib/Aion/Format.pm  view on Meta::CPAN

=item * C<Convert::Number::Roman> is OOP interface.

=item * C<Number::Convert::Roman> is another OOP interface.

=item * C<Text::Roman> convert standart and milhar roman numbers.

=item * C<Roman::Unicode> use digits ↁ (5 000), ↂ (1000), and so on.

=item * C<Acme::Roman> added support roman numerals in perl code (C<< I + II -E<gt> III >>), but use C<+>, C<-> and C<*> operations only.

=item * C<Date::Roman> is Perl OO extension for handling roman style dates, but with arabic numbers (id 3 702).

=item * C<DateTime::Format::Roman> is roman date formatter, but with arabic numbers (5 Kal Jun 2003).

=back

=head2 round ($number, $decimal)

Rounds a number to the specified decimal place.

	round 1.234567, 2  # -> 1.23

lib/Aion/Format/Html.pm  view on Meta::CPAN

		"";
		
		my $s2 = $pre? $+{s2}: ($+{s2} eq "" || $s1? "": " ");
		
		$x =~ /\n/ ? $x: join "", $s1, $x, $s2
	};

	s{
		(?<s1> \s*) (
		
			  <(script|style|template)\b [^<>]*> .*? </ \g1 \s* >
			| <xhr \b [^<>]*> (?<xhr> .*? ) </xhr \s* >
			| < (?<tag> [a-z]\w* ) [^<>]*? (?<close> / )? \s*>
			| </ (?<ctag> [a-z]\w* ) \s*>
			| <!--.*?-->
		
		) (?<s2> \s*)
		| (?<space> [\ \t\n\r\f]+)
		| (?<nbsp> \xa0)
	}{$to->()}genisx;

	$_
}

# Все, кроме запрещённых:
#  applet, script, style, embed, object, param,
#  video, audio, source, track, frame, frameset, iframe, comment
#  html, head, body, title, meta, base, basefont, bgsound, link
#  form, keygen, output, textarea, select, option, optgroup, legend, label, input
#  plaintext, xmp
# А так же удаляет атрибуты начинающиеся на "on", name, for, formaction и др..
my %SAFE_TAG = map {$_=>1} qw/
a
abbr
acronym
address

lib/Aion/Format/Html.pm  view on Meta::CPAN


var

wbr
/;

my %SAFE_ATTR = map {$_=>1} qw/
pubdate datetime
open optimum

dir lang language style tabindex title high low hreflang icon

max min

href media ping rel rev name type

class

src

alt crossorigin decoding height width importance  intrinsicsize loading sizes srcset

t/aion/format.t  view on Meta::CPAN

# 
# See also:
# 
# * `Roman` is simple converter.
# * `Math::Roman` is another converter.
# * `Convert::Number::Roman` is OOP interface.
# * `Number::Convert::Roman` is another OOP interface.
# * `Text::Roman` convert standart and milhar roman numbers.
# * `Roman::Unicode` use digits ↁ (5 000), ↂ (1000), and so on.
# * `Acme::Roman` added support roman numerals in perl code (`I + II -> III`), but use `+`, `-` and `*` operations only.
# * `Date::Roman` is Perl OO extension for handling roman style dates, but with arabic numbers (id 3 702).
# * `DateTime::Format::Roman` is roman date formatter, but with arabic numbers (5 Kal Jun 2003).
# 
# ## round ($number, $decimal)
# 
# Rounds a number to the specified decimal place.
# 
done_testing; }; subtest 'round ($number, $decimal)' => sub { 
::is scalar do {round 1.234567, 2}, scalar do{1.23}, 'round 1.234567, 2  # -> 1.23';
::is scalar do {round 1.235567, 2}, scalar do{1.24}, 'round 1.235567, 2  # -> 1.24';



( run in 0.654 second using v1.01-cache-2.11-cpan-49f99fa48dc )