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

Allowing to pass floating numbers #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fcamblor
Copy link

@fcamblor fcamblor commented Mar 3, 2017

Currently, when we issue a iou @user 12.34 bot complains.

This PR provides support for decimal amount

IMPORTANT note : the change makes previously stored notes incompatible with the new ones as I keep storing amount as number (I only multiply/divide this value by 100, making previously stored values incompatible with new ones)

To be 100% accurate, I would have to provide a migration mongo script to multiply previous notes' amount by 100, but I don't have enough knowledge into mongoose to know if this is easily possible or not.

@mjlescano
Copy link
Owner

Hi @fcamblor! Thanks for this :)

But, there's no need to do the Float hack, because the schema type is already Number and mongoose supports float values.

this way it will capture `123.123` but not `123.`
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

Successfully merging this pull request may close these issues.

2 participants