Skip to content

Context wrapper for calculations with term objects #27

Description

@wilsonfreitas

I have a problem with term objects.

I can't do comparison between term objects because I don't know how to count them (I don't have a daycount).

I can't say that 252 days == 1 year is true, for example, if the daycout is business/252 this is true, otherwise this is not.

The same happens with arithmetic operations, 1 month + 12 days, without a daycount this operation can't be done.

With a context wrapper, that defines the daycount, these expression should be evaluated properly.

t1 <- term(252, "days")
t2 <- term(1, "year")
with_daycount("business/252", t1 == t2)
with_daycount("actual/360", t1 == t2)

These operations are evaluated with the given daycount.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions