Here the rules for numbers in France language. Checked with the link last posting and wikipedia.
Code: Select all
=== France and Canada ===
:: CP850 "é" (ALT+130) = CP1252 "‚" (ALT+0130)
0 = zéro
numbers 1 to 20
1 2 3 4 5 6 7 8 9 10
un deux trois quatre cinq six sept huit neuf dix
onze douze treize quatorze quinze seize dix-sept dix-huit dix-neuf vingt
20 to 100 step 10
vingt trente quarante cinquante soixante --- quatre-vingt --- cent
60 to 79 will use as "60 + (1 to 19)"
80 to 99 will use as "80 + (1 to 19)"
Any numbers xy (with y not 0 or 1) are write as "xxx-yyy"
also number 70 = soixante-dix
also number 90 = quatre-vingt-dix
also number 91 = quatre-vingt-onze
Any numbers x1 (with x are 2, 3, 4, 5, 6, 8) are write as "xxx et un"
only number 71 = "soixante et onze"
Hint to number 80.
If 80 at the end of the double block (six digits) then write -s at the end of the word.
xxx,x80 = quatre-vingts
x80,xxx = quatre-vingt mille
x80,xxx,xxx = quatre-vingts millions
x80,xxx,xxx,xxx = "quatre-vingts milliards" but "quatre-vingt mille millions"
numbers 100 to 999
xy is a number of 1 up to 99
between the hundred and other number is one space
1xy = cent <space> xy
2xy = deux cents <space> xy
up to
9xy = neuf cents <space> xy
numbers 1000 to 999999
1000 = mille
1,yyy = mille yyy
xxx,yyy = xxx mille yyy
numbers 1,000,000 and greater
yyy,zzz is a number 1 up to 999,999
1,yyy,zzz = un million yyy mille zzz
xxx,yyy,zzz = xxx millions yyy mille zzz
1,xxx,yyy,zzz = mille xxx millions yyy mille zzz
www,xxx,yyy,zzz = www mille xxx millions yyy mille zzz
also
1,xxx,yyy,zzz = un milliard xxx millions yyy mille zzz
www,xxx,yyy,zzz = www milliards xxx millions yyy mille zzz
France will use the long scale
1,000^1 = mille
1,000^2 = un million
1,000^3 = mille millions = un milliard
1,000^4 = un billion
1,000^5 = mille billions = un billiard
#####
=== Suisse ===
70, 71, 72 ... = "septante", "septante et un", "septante-deux" ...
80, 81, 82 ... = "huitante", "huitante et un", "huitante-deux" ...
and also
80, 81, 82 ... = "quatre-vints", "quatre-vint-un", "quatre-vint-deux" ...
90, 91, 92 ... = "nonante", "nonante et un", "nonante-deux" ...
=== Belgium ===
70, 71, 72 ... = "septante", "septante et un", "septante-deux" ...
80, 81, 82 ... = "quatre-vints", "quatre-vint-un", "quatre-vint-deux" ...
90, 91, 92 ... = "nonante", "nonante et un", "nonante-deux" ...
The following code will see the words for the very large numbers (million, billion, trillion, etc).
Code: Select all
@echo off
setlocal EnableExtensions EnableDelayedExpansion
set scale=short
if "%1" equ "" (
echo.
echo %0 [/country=GER^|US^|FR] [/scale=short^|long] xxx
echo.
echo /country select specifical settings of informations
echo /scale short - use only million, billion, trillion, ...
echo long - use million, milliard, billion, billiard, ...
echo xxx number of the block for the searching result
echo block number 2 = million
echo block number 3 = billion or milliard
echo block number 4 = trillion or billion
echo use min 2 up to max value
echo if '/scale=short' use max 1 000 000
echo if '/scale=long' use max 1 999 999
echo.
goto :eof
)
:again
if /i "%1" equ "/country" (set land=%2) & shift & shift
if /i "%1" equ "/scale" (set scale=%2) & shift & shift & goto :again
if "%1" neq "" (set completenumber=%1) & shift & if "%1" neq "" goto :again
::
:: possible in this time for variable land are: GER, US, FR
if not defined land set land=US
::
::
:: numbers 1 to 9 not combination prefix
set i=1
for %%a in (mi bi tri quadri quinti sexti septi octi noni) do (
set blockSolo[!i!]=%%a
set /a i+=1
)
:: numbers 1 to 9 with combination prefix
set i=1
for %%a in (un duo tre quattuor quinqua se septe octo nove) do (
set blockComb1[!i!]=%%a
set /a i+=1
)
:: numbers 10 to 90 step 10 with combination prefix
set i=1
for %%a in (deci viginti triginta quadraginta quinquaginta sexaginta septuaginta octoginta nonaginta) do (
set blockComb2[!i!]=%%a
set /a i+=1
)
:: numbers 100 to 900 step 100 with combination prefix
set i=1
for %%a in (centi ducenti trecenti quadringenti quingenti sescenti septingenti octingenti nongenti) do (
set blockComb3[!i!]=%%a
set /a i+=1
)
:: change names to the other language
if /i %land% equ GER (
set blockSolo[8]=okti
set blockComb1[8]=okto
set blockComb2[1]=dezi
set blockComb2[8]=oktoginta
set blockComb3[1]=zenti
set blockComb3[2]=duzenti
set blockComb3[3]=trezenti
set blockComb3[6]=seszenti
set blockComb3[8]=oktingenti
)
:: CP850 "é" (ALT+130) = CP1252 "‚" (ALT+0130)
if /i %land% equ FR (
set blockComb2[1]=d‚ci
)
::
::
:: change the value from short scale to long scale
set gesblock=%completenumber%
set /a tsdnum="gesblock & 1"
if /i %scale% equ long (set /a gesblock=gesblock / 2) else set /a gesblock-=1
if %gesblock% geq 1000 (set /a number=gesblock / 1000) & goto :firstround
:secondround
set /a number="gesblock %% 1000", gesblock=-gesblock
(set "res1=") & (set "res2=") & set "res3="
:firstround
::
:: number is coming as parameter (1 to 999)
::
set /a number=1000%number%, number="number %% 1000"
set /a num1="number %% 10", num2="number %% 100" /10, num3=number /100
set res1=!blockComb1[%num1%]!
set res2=!blockComb2[%num2%]!
set res3=!blockComb3[%num3%]!
if %number% lss 10 (set res1=!blockSolo[%number%]!) & goto :display
:: change the number 5 from "quinqua" to "quin"
:: GER only x15 # US only 0x5 # x is any digit at the position
if /i %land% equ GER if %num2%%num1% equ 15 set res1=quin
if /i %land% equ US if %num3%%num2%%num1% equ 0%num2%5 set res1=quin
:: insert letters "n", "m", "s" and "x"
for %%a in (17 19 37 39 47 49 57 59 67 69 77 79
107 109 207 209 307 309 407 409 507 509 607 609 707 709) do if %number% equ %%a set res1=%res1%n
for %%a in (27 29 87 89 807 809) do if %number% equ %%a set res1=%res1%m
for %%a in (23 26 33 36 43 46 53 56 83 103 803
303 306 403 406 503 506) do if %number% equ %%a set res1=%res1%s
for %%a in (86 106 806) do if %number% equ %%a set res1=%res1%x
:: numbers less 100 change last letter from "a" to "i"
if %number% lss 100 if %num2% gtr 2 set res2=%res2:~0,-1%i
:display
:: any following variable RESULT and SUFFIX will make the big number name
set result=%result%%res1%%res2%%res3%
if %gesblock% geq 1000 (set result=%result%lli) & goto :secondround
if %number% equ 0 set result=%result%ni
if %tsdnum%%scale% equ 1long (
set suffix=lliard
if /i %land% equ GER set suffix=!suffix!e
) else set suffix=llion
set result=%result%%suffix%
if /i %land% equ GER (
rem Capitalize the first word
set firstLetter=!result:~0,1!
for %%a in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do set firstLetter=!firstLetter:%%a=%%a!
set result=!firstLetter!!result:~1!
)
if %completenumber% leq 1 (
echo Error: Use a higher number. Start without parameter.
) else if %gesblock% leq -1000000 (
echo Error: Use a less number. Start without parameter.
) else echo %completenumber% %result%
Here some results from the display:
Code: Select all
C:\Test2>for /l %a in (2,1,11) do @Test40Z /country=GER /scale=long %a
2 Million
3 Milliarde
4 Billion
5 Billiarde
6 Trillion
7 Trilliarde
8 Quadrillion
9 Quadrilliarde
10 Quintillion
11 Quintilliarde
C:\Test2>for /l %a in (2,1,11) do @Test40Z /country=us /scale=short %a
2 million
3 billion
4 trillion
5 quadrillion
6 quintillion
7 sextillion
8 septillion
9 octillion
10 nonillion
11 decillion
C:\Test2>Test40Z /country=fr /scale=long 31
31 quinquadécilliard
The last result is understand as 10^(3*31) = 1000^31 = 10^93 = 10^(6*15+3) = 1,000,000^15 * 1,000.
The factorial of 67 = 36 quinquadécilliard (France, long scale) = 36 trigintillion (US, short scale) = 36 * 10^93.