Skip to content

[SR-3127] Decimal should have accessors to convert to other numeric types #3915

@lilyball

Description

@lilyball
mannequin
Previous ID SR-3127
Radar None
Original Reporter @lilyball
Type Improvement
Additional Detail from JIRA
Votes 1
Component/s Foundation
Labels Improvement
Assignee None
Priority Medium

md5: 5c2629f75730480cb769435605c53f2d

is duplicated by:

  • SR-4396 Decimal.doubleValue should be public

Issue Description:

Decimal should have accessors to produce Int, Int64, and Double values. These accessors should behave similarly to NSDecimalNumber's accessors (ideally they would produce the same values, though it's questionable whether the behavior of NSDecimalNumber is ideal for out-of-range integers). Possibly the integral accessors should return optionals (representing out-of-range numbers; in-range floating-point numbers should just truncate).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions