egomolka / vue-money-format

A Vue component that formats currency.
MIT License
15 stars 8 forks source link

Global Defaults? #11

Open bhaviljain68 opened 3 years ago

bhaviljain68 commented 3 years ago

Hi, is there a way to set the currency and other props globally for a project?? So that I only have to type in the component "" without the props? Because it can get tedious and verbose very soon

egomolka commented 3 years ago

I take your point. The component was set up with the expectation that it would be used for a multi-currency app, and that the exact currency code would always be supplied; however, I will look into adding a project-level default configuration feature..

bhaviljain68 commented 3 years ago

Thank you for considering this.. :)

Another alternate idea i came up with... Though it may not be as useful... A global function that is supplied with a number/amount as the argument (optionally other parameters, else uses defaults set by the developer ) , returns a string with the currency symbol and required precision.

This can used both in the template and in the script.