Hi Acidrums, hi Hans, I worked up the code below, put it in core-con.lua, and recompiled ConTeXt with `context --make cont-en`. It gives the following output. Does it look correct? Hans: the `spanishwords` is a bit hacky; probably words should have subtables words.english and words.spanish. Cheers, Sietse 11.111.111 once millón cien once mil cien once 2.221.101 dos millón doscientos veintiuno mil cien uno 1.111 uno mil cien once 1.218 uno mil doscientos dieciocho 1.234 uno mil doscientos treinta y cuatro 12.345 doce mil trescientos cuarenta y cinco 12.345.678.900.000 doce billón trescientos cuarenta y cinco mil millones seiscientos sietenta y ocho millón novecientos mil local spanishwords = { [0] = "zero", [1] = "uno", [2] = "dos", [3] = "tres", [4] = "cuatro", [5] = "cinco", [6] = "seis", [7] = "siete", [8] = "ocho", [9] = "nueve", [10] = "diez", [11] = "once", [12] = "doce", [13] = "trece", [14] = "catorce", [15] = "quince", [16] = "dieciséis", [17] = "diecisiete", [18] = "dieciocho", [19] = "diecinueve", [20] = "veinte", [21] = "veintiuno", [22] = "veintidós", [23] = "veintitrés", [24] = "veinticuatro", [25] = "veinticinquo", [26] = "veintiséis", [27] = "veintisiete", [28] = "veintiocho", [29] = "veintinueve", [30] = "treinta", [40] = "cuarenta", [50] = "cinquenta", [60] = "sesenta", [70] = "sietenta", [80] = "ochenta", [90] = "noventa", [100] = "cien", [200] = "doscientos", [300] = "trescientos", [400] = "cuatrocientos", [500] = "quinientos", [600] = "seiscientos", [700] = "setecientos", [800] = "ochocientos", [900] = "novecientos", [1000] = "mil", [1000^2] = "millón", [1000^3] = "mil millones", [1000^4] = "billón", } function verbose.spanish(n) local w = spanishwords[n] if w then return w end local t = { } local function compose_one(n) local w = spanishwords[n] if w then t[#t+1] = w return end -- a, b = hundreds, remainder local a, b = floor(n/100), n % 100 -- one thousand if a == 10 then t[#t+1] = spanishwords[1] t[#t+1] = spanishwords[1000] -- x hundred (n.b. this will not give thirteen hundred because -- compose_one(n) is only called after -- `n = compose(two(n, 1000^1))`. elseif a > 0 then t[#t+1] = spanishwords[a*100] end -- the remainder if spanishwords[b] then t[#t+1] = spanishwords[b] else -- a, b = tens, remainder a, b = floor(b/10), n % 10 t[#t+1] = spanishwords[a*10] t[#t+1] = "y" t[#t+1] = spanishwords[b] end end -- compose_two handles x billion, ... x thousand. When 1000 or less is -- left, compose_one takes over. local function compose_two(n,m) if n > (m-1) then local a, b = floor(n/m), n % m if a > 0 then compose_one(a) end t[#t+1] = spanishwords[m] n = b end return n end n = compose_two(n,1000^4) n = compose_two(n,1000^3) n = compose_two(n,1000^2) n = compose_two(n,1000^1) if n > 0 then compose_one(n) end return #t > 0 and concat(t," ") or tostring(n) end verbose.es = verbose.spanish ---- to test the code --- \starttext \def\vbes#1% {#1\crlf \ctxcommand{verbose(#1, "spanish")}} \obeylines \vbes{11111111} \vbes{2221101} \vbes{1111} \vbes{1218} \vbes{1234} \vbes{12345} \vbes{12345678900000} \stopcode