diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-24 18:23:38 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-24 18:23:38 +0000 |
commit | f25b72b68accb03652c7ac58e5c3184f14375d17 (patch) | |
tree | 3834e2f0727466d5c3b218a14e5ffaf64c4e7f35 /locale/de_utf/Num2text | |
parent | e29b7e69171ae4faa116f00f0d55e6bf9a6438a4 (diff) |
Convert German translations to gettext
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@291 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'locale/de_utf/Num2text')
-rwxr-xr-x | locale/de_utf/Num2text | 185 |
1 files changed, 0 insertions, 185 deletions
diff --git a/locale/de_utf/Num2text b/locale/de_utf/Num2text deleted file mode 100755 index 87b45c0f..00000000 --- a/locale/de_utf/Num2text +++ /dev/null @@ -1,185 +0,0 @@ -#===================================================================== -# LedgerSMB Small Medium Business Accounting -# Copyright (C) 2002 -# -# Author: Dieter Simader -# Email: dsimader@sql-ledger.org -# Web: http://www.ledgersmb.org/ -# -# Contributors: -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#====================================================================== -# -# this is a variation of the Lingua package -# written for check and receipt printing -# it returns a properly formatted text string -# for a number up to 10**12 - -sub init { - my $self = shift; - - %{ $self->{numbername} } = - (0 => 'Null', - 1 => 'ein', - 2 => 'zwei', - 3 => 'drei', - 4 => 'vier', - 5 => 'fünf', - 6 => 'sechs', - 7 => 'sieben', - 8 => 'acht', - 9 => 'neun', - 10 => 'zehn', - 11 => 'elf', - 12 => 'zwölf', - 13 => 'dreizehn', - 14 => 'vierzehn', - 15 => 'fünfzehn', - 16 => 'sechzehn', - 17 => 'siebzehn', - 18 => 'achtzehn', - 19 => 'neunzehn', - 20 => 'zwanzig', - 30 => 'dreissig', - 40 => 'vierzig', - 50 => 'fünfzig', - 60 => 'sechzig', - 70 => 'siebzig', - 80 => 'achtzig', - 90 => 'neunzig', - 10**2 => 'hundert', - 10**3 => 'tausend', - 10**6 => 'million', - 10**9 => 'milliarde', - 10**12 => 'billion' - ); - -} - - -sub num2text { - my ($self, $amount) = @_; - - return $self->{numbername}{0} unless $amount; - - my @textnumber = (); - - # split amount into chunks of 3 - my @num = reverse split //, abs($amount); - my @numblock = (); - my ($i, $appendn); - my @a = (); - - while (@num) { - @a = (); - for (1 .. 3) { - push @a, shift @num; - } - push @numblock, join / /, reverse @a; - } - - my $belowhundred = !$#numblock; - - while (@numblock) { - - $i = $#numblock; - @num = split //, $numblock[$i]; - $appendn = ""; - - $numblock[$i] *= 1; - - if ($numblock[$i] == 0) { - pop @numblock; - next; - } - - if ($numblock[$i] > 99) { - # the one from hundreds - push @textnumber, $self->{numbername}{$num[0]}; - - # add hundred designation - push @textnumber, $self->{numbername}{10**2}; - - # reduce numblock - $numblock[$i] -= $num[0] * 100; - } - - $appendn = 'en' if ($i == 2); - $appendn = 'n' if ($i > 2); - - if ($numblock[$i] > 9) { - # tens - push @textnumber, $self->format_ten($numblock[$i], $belowhundred); - } elsif ($numblock[$i] > 1) { - # ones - push @textnumber, $self->{numbername}{$numblock[$i]}; - } elsif ($numblock[$i] == 1) { - if ($i == 0) { - push @textnumber, $self->{numbername}{$numblock[$i]}.'s'; - } else { - if ($i >= 2) { - push @textnumber, $self->{numbername}{$numblock[$i]}.'e'; - } else { - push @textnumber, $self->{numbername}{$numblock[$i]}; - } - } - $appendn = ""; - } - - # add thousand, million - if ($i) { - $amount = 10**($i * 3); - push @textnumber, $self->{numbername}{$amount}.$appendn; - } - - pop @numblock; - - } - - join '', @textnumber; - -} - - -sub format_ten { - my ($self, $amount, $belowhundred) = @_; - - my $textnumber = ""; - my @num = split //, $amount; - - if ($amount > 20) { - if ($num[1] == 0) { - $textnumber = $self->{numbername}{$amount}; - } else { - if ($belowhundred) { - $amount = $num[0] * 10; - $textnumber = $self->{numbername}{$num[1]}.'und'.$self->{numbername}{$amount}; - } else { - $amount = $num[0] * 10; - $textnumber = $self->{numbername}{$amount}.$self->{numbername}{$num[1]}; - $textnumber .= 's' if ($num[1] == 1); - } - } - } else { - $textnumber = $self->{numbername}{$amount}; - } - - $textnumber; - -} - - -1; - |