Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mrlegowatch opened this issue Feb 19, 2017 · 0 comments
Labels

Comments

@mrlegowatch
Copy link
Owner

mrlegowatch commented Feb 19, 2017

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant