|
I agree - too obscure. Never realized you can only use integers in %div - thanks.
Quarter = %div(Month : 3.01) + 1;
The compiler won't like that one. Make it normal division q=(m/3.01)
+1 and it works. I don't like this because it's obscure.
At least in my actual code I typed this one correctly. %dim never had a chance :)
Quarter %dim(Month + 2 : 3);
I don't like that one either. It makes it harder to deal with
financial quarters.
True. I left the formula in the C spec for this one because we do not really do much by quarter anyhow, and we use a straight calendar. This one program is the only one I have seen here with any mention of quarters at all. And even then it is largely ignored.
For me I wouldn't do this calculation in direct code. I'd write a
generic procedure:
getQuarterOfYear( date [, fiscalPeriodStart] )
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.