Discussion:
PBWin : Needed MACRO's for different format functions
(too old to reply)
volleballertje26
2003-07-31 07:06:29 UTC
Permalink
Dear programmers,

1. Can someone help me for written the next macro's for:
- format floating numbers
- format percents
- format date and time

I have no experience of the WinAPI, I'm sorry

a) MACRO FormatNumber()
b) MACRO FormatPercent()

c)MACRO FormatDate()
- FormatDate have the next format options
--> d = the day of the month (1-31)
--> dd = the day of the month (01-31)
--> ddd = the first second chars of the naam of the day (su-sa)
--> dddd = the full name of the day (sunday-saterday)

--> w = the number of the day in the week (1-7)
--> ww = the number of the week in the year (1-54)

--> m = the month of the year (1-12)
--> mm = the month of the year (01-12)
--> mmm = the first three chars of the name from the month (jan-dec)
--> mmmm = the full name of the month (januari-december)

--> q = the number of the quartal in the year (1-4)

--> y = the daynumber of the year (1-366)
--> yy = the least two digits of the year (01-99)
--> yyyy = the full year (0100-9999)

MACRO FormatTime()

--> the same for the time : (:, h, hh, n, nn, s, ss, AM/PM)

I have needed this MACRO's needed for my project !

Please help me for written this MACRO (Functions)

Thanks in advance
Stephane
Michael Mattias
2003-07-31 10:18:48 UTC
Permalink
Post by volleballertje26
Dear programmers,
- format floating numbers
- format percents
PowerBASIC (Windows) compilers include a FORMAT$ function which will do
this.
Post by volleballertje26
- format date and time
[multiple formats requested]
I have no experience of the WinAPI, I'm sorry
Well, too damn bad, because the easiest way to format dates as requested is
to use the WinAPI calls GetDateFormat and GetTimeFormat. That call supports
everything you asked for except the calendar quarter, which isn't really too
hard once you have the "month number" (Quarterno=CEIL(MonthNo/3))

MCM

Loading...