Post Reply 
DDAYS and "financial" year
05-17-2015, 09:25 AM (This post was last modified: 05-17-2015 09:27 AM by salvomic.)
Post: #1
DDAYS and "financial" year
hi,
DDAYS is really useful (like also DATEADD and DAYOFWEEK)!
In a next update of FW it would be nice to add an option to handle "financial" (or "commercial") year (months of 30 days, 360 days of years), useful for calculation of simple interest (like HP 12C do).

Formulas are in the User Guide of 12C (Appendix E, page 250). 12C can handles dates both as m.ddyyyy, d.mmyyyy, so those formulas are intended for theese formats...

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
05-17-2015, 09:58 PM
Post: #2
RE: DDAYS and "financial" year
maybe it's enough a formula as n:=30*(mm2-mm1)+dd2-dd1 like in my program to calc Simple Interest...
dd1, dd2 are days, mm1, mm2 months ...

However attention for a problem in DDAYS: it doesn't control for "typical" errors:
i.e. DDAYS(2015.0201,2015.0229) gives "Error: invalid input", as Feb 29 doesn't exists (in 2015)...
We need also a leap year control :-)

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
05-19-2015, 12:58 PM
Post: #3
RE: DDAYS and "financial" year
Moreover DDAYS ignores date format settings, e.g. with European format preset (mm/dd/yyyy), it nevertheless wants input in the form yyyy.mmdd
Find all posts by this user
Quote this message in a reply
05-20-2015, 03:12 AM
Post: #4
RE: DDAYS and "financial" year
(05-19-2015 12:58 PM)rkf Wrote:  Moreover DDAYS ignores date format settings, e.g. with European format preset (mm/dd/yyyy), it nevertheless wants input in the form yyyy.mmdd

All the date functions are like that, to be consistent with the Date system variable, which always returns dates in YYYY.MMDD format. I'm pretty sure that the "date format display" Home Setting only changes the display of the Home Settings screen (page 2) and the upper-right-corner popup clock/calendar; it has no effect on programs. This is a Good Thing.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)