Skip to content

Text('f'): 0 x 100 = 000 #136

Description

@Sroose

When multiplying 0 with some number, the resulting Text('f') shows too many zeroes. I expect the result to return "0"

x := new(apd.Decimal)
_, _ = x.SetFloat64(0)

multiplier := new(apd.Decimal)
_, _ = multiplier.SetFloat64(100)

result := new(apd.Decimal)
_, _ = apd.BaseContext.Mul(result, x, multiplier)

fmt.Println(result.Text('f')) // 000

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