Closed lgg closed 8 years ago
You are correct. Thanks for noticing it. As far as I see your PR still ignores the decimalCount = 0 I suggest to change that line as follows:
if (options && options.decimalCount >= 0) _decimalCount = options.decimalCount;
So if you want it to return only integers you can set the decimalCount to zero. Any comments?
@dorukeker which PR you watched? In #19 I changed to checking number.
I think this options.decimalCount >= 0
will throw an error when no options
object provided.
@littleguga I merged your PR.
I will add the check to be greater than 0 (it does not break even if args is not provided). Also adding a parseInt()
so even if the user passes a float (e.g. 2.3) library will use the integer value.
Thanks for pointing out.
@dorukeker I think we need to rebuild /dist/
?
@littleguga
Yes :) It is built. I did not prepare a release for it. But if you check out the repo the dist/
folder contains the new version.
Are you planning to use it on a project? Or research?
@dorukeker big thanks!
I am using it my project - a little game for mobile devices in local network, when it will be done - I will publish it on github.
If I set init args decimalCount to 0. It returns 2 digit after point.
I think we need change something here: https://github.com/dorukeker/gyronorm.js/blob/master/lib/gyronorm.js#L108