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

Currencies support #32

Open
tnelson-doghouse opened this issue Apr 15, 2022 · 2 comments
Open

Currencies support #32

tnelson-doghouse opened this issue Apr 15, 2022 · 2 comments

Comments

@tnelson-doghouse
Copy link

I saw in the documentation that you mentioned that currencies were an omission.

Would it be possible to support currencies with the caveat that they're only as up-to-date as the exchange rates in use?

Thanks!

@df7cb
Copy link
Owner

df7cb commented Apr 15, 2022

The current design is that internally, everything is broken down to units in the 7 SI units and "byte". These 8 exponents are then stored as 8 bytes along with the double precision value, so 8+8=16 bytes.

Adding currencies would require a basically unbounded number of base units. That's how GNU units works, so it would make sense to switch to that model, but it would be a new datatype with a different storage representation in PostgreSQL (most probably varlena-based).

I might actually implement that some day.

@df7cb df7cb changed the title Currency Currencies support Apr 15, 2022
@tnelson-doghouse
Copy link
Author

Ah, that makes sense. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants