Skip to content

RoundUp can round a number that shouldn't be rounded #388

@smaant

Description

@smaant
d := decimal.RequireFromString("3.692").Mul(decimal.RequireFromString("1.25"))
fmt.Println(d)             // 4.615
fmt.Println(d.RoundUp(3))  // 4.616

at the same time

d := decimal.RequireFromString("4.615")
fmt.Println(d.RoundUp(3))  // 4.615

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions