Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a0cd7d69

Von Thomas Heck vor etwa 12 Jahren hinzugefügt

  • ID a0cd7d697f36397a32a90565fee3986f95f17e93
  • Vorgänger f33abdbb
  • Nachfolger d3d239c9

Tests zu SL::Format::format_amount mit Beschreibung versehen

Unterschiede anzeigen:

t/form/format_amount.t
24 24

  
25 25
$config->{numberformat} = '1.000,00';
26 26

  
27
is($form->format_amount($config, '1e1', 2), '10,00', 'blaa');
28
is($form->format_amount($config, 1000, 2), '1.000,00', 'blaa');
29
is($form->format_amount($config, 1000.1234, 2), '1.000,12', 'blaa');
30
is($form->format_amount($config, 1000000000.1234, 2), '1.000.000.000,12', 'blaa');
31
is($form->format_amount($config, -1000000000.1234, 2), '-1.000.000.000,12', 'blaa');
27
is($form->format_amount($config, '1e1', 2), '10,00', 'format 1e1 (numberformat: 1.000,00)');
28
is($form->format_amount($config, 1000, 2), '1.000,00', 'format 1000 (numberformat: 1.000,00)');
29
is($form->format_amount($config, 1000.1234, 2), '1.000,12', 'format 1000.1234 (numberformat: 1.000,00)');
30
is($form->format_amount($config, 1000000000.1234, 2), '1.000.000.000,12', 'format 1000000000.1234 (numberformat: 1.000,00)');
31
is($form->format_amount($config, -1000000000.1234, 2), '-1.000.000.000,12', 'format -1000000000.1234 (numberformat: 1.000,00)');
32 32

  
33 33

  
34 34
$config->{numberformat} = '1,000.00';
35 35

  
36
is($form->format_amount($config, '1e1', 2), '10.00', 'blaa');
37
is($form->format_amount($config, 1000, 2), '1,000.00', 'blaa');
38
is($form->format_amount($config, 1000.1234, 2), '1,000.12', 'blaa');
39
is($form->format_amount($config, 1000000000.1234, 2), '1,000,000,000.12', 'blaa');
40
is($form->format_amount($config, -1000000000.1234, 2), '-1,000,000,000.12', 'blaa');
36
is($form->format_amount($config, '1e1', 2), '10,00', 'format 1e1 (numberformat: 1,000.00)');
37
is($form->format_amount($config, 1000, 2), '1.000,00', 'format 1000 (numberformat: 1,000.00)');
38
is($form->format_amount($config, 1000.1234, 2), '1.000,12', 'format 1000.1234 (numberformat: 1,000.00)');
39
is($form->format_amount($config, 1000000000.1234, 2), '1.000.000.000,12', 'format 1000000000.1234 (numberformat: 1,000.00)');
40
is($form->format_amount($config, -1000000000.1234, 2), '-1.000.000.000,12', 'format -1000000000.1234 (numberformat: 1,000.00)');
41 41

  
42 42
done_testing;
43 43

  

Auch abrufbar als: Unified diff