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

Monetary types and fraction digits #20

Open
tomaszstrojny opened this issue Oct 2, 2018 · 0 comments
Open

Monetary types and fraction digits #20

tomaszstrojny opened this issue Oct 2, 2018 · 0 comments

Comments

@tomaszstrojny
Copy link

Hi.
I have created plugin for using money painlessly in OctoberCMS that extends yours (it is waiting in Marketplace for approval, right now you can see it only on Github: https://github.com/initbizlab/oc-money-plugin).

Its main feature for now is a form widget that formats amount-input (on blur, using format defined in currency), dropdown with currencies in the field and is managing fraction digits so that the amount can be stored as integer in database.

But I am not writing here for advertising ;) I am just curious why you have not add such field as decimals or fraction_digits to your Currency model. For me it makes sense to store default precision in database, because we will know how many places are decimals while storing the amount as integer. Right now your plugin is enforcing users to use float or doubles for their amounts and this is not good practice (or am I missing something?).

My plugin updates your currencies table (adds the fraction_digits field) and wraps the functionality in such a way that users will not see integers, but nice formatted strings.

If you think it makes sense we should join forces here or just please remember about my plugin on your plugin updates :)

I was considering creating you PRs instead of writing new plugin, but I want to have full control over this code since I want to add more features that concerns money problems while developing.

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

1 participant