this code works for english, spanish and german ordninal numbers, but with russian or italian ordninal numbers it doesn't work.
'ru-RU'
,'it-IT'
also don't work
I get for example in russian for 2 -> два (this is the cardinal number) , but I want the ordinal number and this would be here 2 -> второй.
I get for example in italian for 2 -> due (this is the cardinal number) , but I want the ordinal number and this would be here 2 -> secondo.
Update:
I found a solution with works in french, spain, german and some other languages:
maskuline ordinal numbers: %spellout-ordinal-maskuline
feminine ordinal numbers: %spellout-ordinal-feminine
russian and italian version doesn't work and I tried already with -maskuline/-feminine
$ru_ordinal = new NumberFormatter('ru', NumberFormatter::SPELLOUT);
$ru_ordinal->setTextAttribute(NumberFormatter::DEFAULT_RULESET, "%spellout-ordinal");
format(42)
result is (in order): "сорок два", "cuarenta y dos" and "quaranta due". Is this the expected output? Make sure you have intl installed. – Augustus$ru_ordinal->format(42);
returns сорок два instead of сорок второй. this is weird – Sanfordsanfourdit's the second day
and you don't want:It's the two day
right? – Kutenaiit's the second day
in all languages or do you want it likeit's the two day
? Like you don't want to use the number translated alone, you wanted it with a date or something like that? – Kutenaisecond
. I want to translate the number alone! – Bradstreetвторой
right? and right now you get the first one? – Kutenaidue
instead of 2 ->secondo
. – Bradstreet