Skip to content

Suggestion: Don't use float/double in constructors #43

Closed
@Allann

Description

@Allann

I really like the Amount class, however you will soon find you get rounding issues if you use float and double casting in the amount constructor. I would suggest you always only accept decimal types.

Money.zip

I created a money datatype a while back I thought I'd share as I did the currency slightly differently which you might want to have a look at. This technique doesn't require specific currency types but instead leverages culture/region info built into .Net standard.

I'd be interested in helping out if you'd like my help.

Here are the tests for the above project if needed.

MoneyFacts.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions