Assuming compount interest, I think the original formula is incorrect. You can't just divide the annual interest rate by 365.
The division is in the wrong place.
What needs to be clear is that the power function works for both integer and non-integer numbers. So, just as you put
>nCompVal = nStartVal * ( 1 + i ) ^ n where
>
>i=interest rate
>n=number of compounding periods
>
you can simply use:
nCompVal = nStartVal * (1 + i) ^ (days / 365)
assuming you want to calculate on the basis of 365 days per year.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)