3 # # CZECH TRANSLATORS COMMENTS see Locale::Maketext::TPJ13
4 # Obecne parametry musi byt docela slozite (v pripade Slavistickych jazyku)
5 # typu pocet, slovo, pad a rod
11 #5.. krecku (nehodi se zde resit pravidlo mod 1,2,3,4 krom mod 11,12,13,14)
18 # => Vyplati se udelat quant s parametry typu pocet, slovo1, slovo2..4, slovo5 a slovo0
22 my($handle, $num, @forms) = @_;
24 return $num if @forms == 0; # what should this mean?
25 return $forms[3] if @forms > 3 and $num == 0; # special zeroth case
28 # Note that the formatting of $num is preserved.
29 #return( $handle->numf($num) . ' ' . $handle->numerate($num, @forms) );
30 return( $handle->numerate($num, @forms) );
31 # Most human languages put the number phrase before the qualified phrase.
36 # return this lexical item in a form appropriate to this number
37 my($handle, $num, @forms) = @_;
40 return '' unless @forms;
43 ( $num > 1 && $num < 5 ) ? $forms[1] :
47 #--------------------------------------------------------------------------
50 my($handle, $num) = @_[0,1];
51 if($num < 10_000_000_000 and $num > -10_000_000_000 and $num == int($num)) {
52 $num += 0; # Just use normal integer stringification.
53 # Specifically, don't let %G turn ten million into 1E+007
55 $num = CORE::sprintf("%G", $num);
56 # "CORE::" is there to avoid confusion with the above sub sprintf.
58 while( $num =~ s/^([-+]?\d+)(\d{3})/$1,$2/s ) {1} # right from perlfaq5
59 # The initial \d+ gobbles as many digits as it can, and then we
60 # backtrack so it un-eats the rightmost three, and then we
61 # insert the comma there.
63 $num =~ tr<.,><,.> if ref($handle) and $handle->{'numf_comma'};
64 # This is just a lame hack instead of using Number::Format