HP Forums
DDAYS and "financial" year - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: DDAYS and "financial" year (/thread-3873.html)



DDAYS and "financial" year - salvomic - 05-17-2015 09:25 AM

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


RE: DDAYS and "financial" year - salvomic - 05-17-2015 09:58 PM

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 :-)


RE: DDAYS and "financial" year - rkf - 05-19-2015 12:58 PM

Moreover DDAYS ignores date format settings, e.g. with European format preset (mm/dd/yyyy), it nevertheless wants input in the form yyyy.mmdd


RE: DDAYS and "financial" year - Joe Horn - 05-20-2015 03:12 AM

(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.