File: demo_currency_table.pl

package info (click to toggle)
libperl6-form-perl 0.090-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 584 kB
  • sloc: perl: 3,080; makefile: 8
file content (26 lines) | stat: -rwxr-xr-x 669 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use 5.010;
use warnings;

use Perl6::Form;

my @amounts = (0, 1, 1.2345, 1234.56, -1234.56, 1234567.89);
# my @amounts = qw(0 1,0 1,2345 1234,56 -1234,56 1234567,89);

my %format = (
	"Canadian (English)"	=> q/   {-$],]]],]]].0}/,
	"Canadian (French)"		=> q/    {-] ]]] ]]],0 $}/,
	"Dutch"					=> q/     {],]]],]]].0-EUR}/,
	"Swiss"					=> q/{Sfr -]']]]']]].0}/,
	"German (pre-euro)"		=> q/    {-].]]].]]],[DM}/,
	"Norwegian"				=> q/ {kr -].]]].]]],0}/,
	"Indian"				=> q/    {-]],]],]]].0Rs}/,
	"Portuguese (pre-euro)"	=> q/    {-].]]].]]]$0 Esc}/,
);

while (my($style, $format) = each %format) {
	print form
		"$style:\n\n",
		"    $format",
		\@amounts,
		"\n";
}