1 #=====================================================================
\r
2 # SQL-Ledger Accounting
\r
5 # Author: Dieter Simader
\r
6 # Email: dsimader@sql-ledger.org
\r
7 # Web: http://www.sql-ledger.org
\r
8 # Modified by: Medgyesi Aniko
\r
9 # **********************************
\r
10 # *#MEA1 * Hungarian version *
\r
11 # **********************************
\r
14 # This program is free software; you can redistribute it and/or modify
\r
15 # it under the terms of the GNU General Public License as published by
\r
16 # the Free Software Foundation; either version 2 of the License, or
\r
17 # (at your option) any later version.
\r
19 # This program is distributed in the hope that it will be useful,
\r
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
22 # GNU General Public License for more details.
\r
23 # You should have received a copy of the GNU General Public License
\r
24 # along with this program; if not, write to the Free Software
\r
25 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
\r
26 #=====================================================================
\r
28 # this is the default code for the Check package
\r
30 #=====================================================================
\r
34 #MEA1 English number ignored
\r
35 # %{ $self->{numbername} } =
\r
53 # 17 => 'Seventeen',
\r
64 # 10**2 => 'Hundred',
\r
65 # 10**3 => 'Thousand',
\r
66 # 10**6 => 'Million',
\r
67 # 10**9 => 'Billion',
\r
68 # 10**12 => 'Trillion',
\r
70 #MEA1BEG Hungarian numbers
\r
71 %{ $self->{numbername} } =
\r
91 19 => 'tizenkilenc',
\r
94 22 => 'huszonkettõ',
\r
95 23 => 'huszonhárom',
\r
100 28 => 'huszonnyolc',
\r
101 29 => 'huszonkilenc',
\r
112 10**9 => 'milliárd',
\r
113 10**12 => 'billió',
\r
121 my ($self, $amount) = @_;
\r
123 return $self->{numbername}{0} unless $amount;
\r
125 my @textnumber = ();
\r
127 # split amount into chunks of 3
\r
128 my @num = reverse split //, abs($amount);
\r
138 push @a, shift @num;
\r
140 push @numblock, join / /, reverse @a;
\r
142 while (@numblock) {
\r
144 @num = split //, $numblock[$i];
\r
146 if ($numblock[$i] == 0) {
\r
150 if ($numblock[$i] > 99) {
\r
151 push @textnumber, $self->{numbername}{$num[0]};
\r
153 # add hundred designation
\r
154 push @textnumber, $self->{numbername}{10**2};
\r
157 $numblock[$i] -= $num[0] * 100;
\r
161 $numblock[$i] *= 1;
\r
162 if ($numblock[$i] > 9) {
\r
164 push @textnumber, $self->format_ten($numblock[$i]);
\r
165 } elsif ($numblock[$i] > 0) {
\r
167 push @textnumber, $self->{numbername}{$numblock[$i]};
\r
170 # add thousand, million
\r
172 #MEA1BEG above 2000 need hyphen between treegroups
\r
173 # if ($numblock[$i] > 9) {
\r
174 # push @textnumber, $self->format_ten($numblock[$i]);
\r
175 # } elsif ($numblock[$i] > 0) {
\r
176 # push @textnumber, $self->{numbername}{$numblock[$i]};
\r
178 if ($i==1 && $amount < 2000){
\r
180 $num = 10**($i * 3);
\r
181 push @textnumber, $self->{numbername}{$num};
\r
184 $num = 10**($i * 3);
\r
185 push @textnumber, $self->{numbername}{$num}."-";
\r
193 #MEA1BEG First charachter is uppercase
\r
194 # join '', @textnumber;
\r
195 $res=ucfirst join '', @textnumber;
\r
197 #MEA1BEG remove last hyphen
\r
207 my ($self, $amount) = @_;
\r
209 my $textnumber = "";
\r
210 my @num = split //, $amount;
\r
211 #MEA1BEG above 30 not above 20
\r
212 # if ($amount > 30) {
\r
213 if ($amount > 30) {
\r
215 $textnumber = $self->{numbername}{$num[0]*10};
\r
218 $textnumber = $self->{numbername}{$amount};
\r
222 $textnumber .= "".$self->{numbername}{$amount} if $amount;
\r