Skip to content

UnitCurrency.baseUnit() requires initialization from load() otherwise it unwraps nil #11

Description

@mrlegowatch

UnitCurrency requires being initialized from load() in order to allow customization for domain-specific currency (D&D 'coinage', space/future 'credits', etc.), but this means that baseUnit() can't return an unwrapped default currency if load() hasn't been called yet. The first loaded currency with a 'default' property wins.

Ideas to consider:

  • provide a default unit currency (e.g., "gp") whose symbol etc. can be overridden thru load()
  • allow the last loaded currency with a 'default' property to win

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions