Skip to content

[G35_Decorator_1] The value type don't match main function comments #7

@falloutkid

Description

@falloutkid

This is main function comments

// 7% tax: 19*1.07 = 20.33
// 20% discount, 19% tax: (999*0.8)*1.19 = 951.05

And output format is followings.

std::ostream& operator<<( std::ostream& os, Money money )
{
   return os << money.value;
}

So, I think output type is 'value' field type. Then 'value' field type is uint64_t.

uint64_t value{};

return Money{ static_cast<uint64_t>( money.value * factor ) };

If main comments is collect, it should change uint64_t to double(or float).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions