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

Support for digital currencies #79

Closed
josecelano opened this issue Jan 27, 2015 · 4 comments
Closed

Support for digital currencies #79

josecelano opened this issue Jan 27, 2015 · 4 comments

Comments

@josecelano
Copy link

Add digital currencies to currencies.php array (at least bitcoin).

@mathiasverraes
Copy link
Collaborator

Merged the PR. In the 3.0 release, it will be easier to use your own currencies.

@josecelano
Copy link
Author

Thanks!

@josecelano
Copy link
Author

Bitcoin has 8 decimal places and the maximun amount available will be 21 millions (when bitcoin mining ends). Decimal places of bitcoins are called "satoshis". 21 millions converted to satoshis would be: 21.000.000 * 10^8 which is greater than max integer in 32-bit system (2.147.483.647).

Therefore, it is not sufficient to add BTC to currencies list.

I have read in this issue:
#7
that your are planning to add BigMoney class to allow decimal scalability. In the bitcoin case it is needed scalability even without using more than 8 decimals, but It seems you do not like using float as I have read here:
https://github.com/mathiasverraes/money/pull/55/files#r16972250

With int type max value (32 bit system), bitcoin amount would be 21.47483648 satoshis which is a very small amount.

Could bitcoin be used with that BigMoney class?

@josecelano
Copy link
Author

Could be possible to use DecimalN like this:
https://github.com/ikr/money-math-php/tree/master/src/MoneyMath instead of int?

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