Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FPW 2.6 / Ordinal numbers
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00039855
Message ID:
00040104
Vues:
27
Looks good to me. Actually, I was trying to make my approach more generic; with minor changes it would work for any number.

>> Roughly, it would be something like this:
>> Define a variable lnDay in your report, or in the calling program, where
>> lnday = IIF(BETWEEN(DAY(DATE()), 10, 20) .OR. MOD(DAY(DATE()), 10) = 0, 9,
>> MOD(DAY(DATE()), 10))
>> The expression to display the ordinal day number would be :
>> ALLTRIM(STR(DAY(DATE()))) + iif(lnDay < 2, 'st', iif(lnDay < 3, 'nd',
>> iif(lnDay < 4, 'rd', "th")))
>>
>> >Anyone know how to put ordinal numbers in a report. I need to print the
>> day
>> >of the date as
>> >
>> >1st
>> >2nd
>> >3rd
>> >4th..... etc.
>
>How about a call to the following UDF:
>
>proceudre Day_th
>parameter ldDate
>m.lnDay = day(m.lnDate)
>m.lcReturn = "th"
>do case
> case m.lnDay = 1 or m.lnDay = 21 or m.lnDay = 31
> m.lcReturn = "st"
> case m.lnDay = 2 or m.lnDay = 22
> m.lcReturn = "nd"
> case m.lnDay = 3 or m.lnDay = 23
> m.lcReturn = "rd"
>endcase
>return m.lcReturn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform