VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Format Fancy Number (##st, ##nd, ##rd, ##th)

Alex Nunn  (1 Submission)   String Manipulation   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

This function adds st, nd, rd, or th to the end of a string of numbers based on what the number is. For example, the following code can produce the following output, "Thursday, November 23rd, 2000" : Format(Date, "dddd, mmmm ") & FormatFancyNumber(Day(Date)) & ", " & Year(Date)

Inputs
All this function needs is an integer number in string format.

Returns
It returns the number in string format with st, nd, rd, or th added to the end as needed.

Side Effects
The code currently only works with integer size numbers. This should be easy to change though considering the size of code.

Rate Format Fancy Number (##st, ##nd, ##rd, ##th) (3(3 Vote))
Format Fancy Number (##st, ##nd, ##rd, ##th).bas

Format Fancy Number (##st, ##nd, ##rd, ##th) Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters