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

Rounding Currency #8

Open
toddca opened this issue Nov 30, 2012 · 4 comments
Open

Rounding Currency #8

toddca opened this issue Nov 30, 2012 · 4 comments

Comments

@toddca
Copy link

toddca commented Nov 30, 2012

I want to allow my users to enter a value such as 56.33 and have this rounded and displayed as 56.00 - I cannot seem to figure out the combination of options that allows my users to type 56.33 or 56.1 and have these numbers rounded to 56.00 and also displayed as 56.00.

@toddca
Copy link
Author

toddca commented Nov 30, 2012

I found a workaround which appears to work (the best kind)

/inside a selector/
var options = { mDec: 2, vMin: minValue, vMax: maxValue };
$(this).autoNumeric(options);

/Round the currency/
$(this).blur(function () {
if ($(this).val() != '') {
$(this).autoNumericSet(Math.round($(this).autoNumericGet()));
}
});

@BobKnothe
Copy link
Collaborator

Todd,

Glad you found a solution.

I have been working on a major update. It is basically done, i just need
to update the documentation
(http://www.decorplanit.com/plugin/autoNumeric-1.8.0-beta.htm).

Let me know if you have any questions.

Best regards,

Bob

On 11/30/2012 10:52 AM, Todd Carter wrote:

I found a workaround which appears to work (the best kind)

/inside a selector/
var options = { mDec: 2, vMin: minValue, vMax: maxValue };
$(this).autoNumeric(options);

/Round the currency/
$(this).blur(function () {
if ($(this).val() != '') {
$(this).autoNumericSet(Math.round($(this).autoNumericGet()));
}
});


Reply to this email directly or view it on GitHub
#8 (comment).

@toddca
Copy link
Author

toddca commented Nov 30, 2012

So Bob, is version 1.8 suppose to address this issue? I has half expecting another param such as rDec which would define the number of decimal values to round to, Currently it appears we use mDec to do this but IMO mDec should be more for driving how the number should be displayed and not necessarily how it is rounded. So rDec (if it existed) could default to mDec and this would give us the option to set rDec to 0 and mDec to 2 and it would be reasonable to expect that would address the issue here.

@BobKnothe
Copy link
Collaborator

Todd,

No 1.80 does not address your requirements - BTW you are the first to
suggest this feature be added.

This can be looked at for future releases.

Best regards,

Bob

On 11/30/2012 3:29 PM, Todd Carter wrote:

So Bob, is version 1.8 suppose to address this issue? I has half
expecting another param such as rDec which would define the number of
decimal values to round to, Currently it appears we use mDec to do
this but IMO mDec should be more for driving how the number should be
displayed and not necessarily how it is rounded. So rDec (if it
existed) could default to mDec and this would give us the option to
set rDec to 0 and mDec to 2 and it would be reasonable to expect that
would address the issue here.


Reply to this email directly or view it on GitHub
#8 (comment).

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