I'm curious if this plugin can accomplish money masking, so that there are always 2 digits on the right?
So, for $74.25, the flow would go: $0.00 $0.07 $0.74 $7.42 $74.25
Does that make sense? I currently have .inputmask("decimal",{digits: 2, autoGroup: true}); and it locks the last 2 in place, but isn't giving me what I'm thinking.
http://jsfiddle.net/scottned/8Jpdd/4/ - found this...
http://jsfiddle.net/3yDW4/ - and that... but that leaves the commas and stuff, which doesn't seem right.
Duh, numericInput. .inputmask("decimal",{digits: 2, numericInput: true}) This doesn't seem to be working though...
jquery.inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. [}2{~:]}+,1{~[+]
@dudo ,
I'm currently working on the numeric alias. I will keep you informed
Thanks! http://plentz.github.io/jquery-maskmoney/ you might be able to 'borrow' some code from this repo... /shrug. If you need a hand, just point me to the appropriate file =)
@dudo ,
Can you have a try with the currency alias (see numeric extensions)
Usage $(input).inputmask("currency");

.inputmask("currency", { radixPoint: "." }) default radix seems to be a ,? When I try to change it, I get some very weird behavior when deleting numbers (the pic). Also, not sure why that character isn't showing up? I'm on the newest version of chrome. (I know I can use prefix: '' to alleviate it, just curious)
Also, it doesn't seem to want to put any numbers on the right hand... just fills in numbers on the right.
I downloaded the newest master to test this.
I made this... http://jsfiddle.net/msj5qfu1/
@dudo ,
You used the same symbol for groupseparator and radixpoint. Anyway this case is know handled in code.
ah, I didn't realize I had to update the groupSeparater as well, thank you!
similar to #376... Is there a way to start typing to the right of the radix? If you want $15.00, with no cents, then it's easy as it is, but if you want cents, you have to arrow over, or click into the right section. Is there a way to make $15.00 1``5``0``0?
another 'duh' on my part... I read through the source code to finally realize that pressing the radix key was sufficient (and makes perfect sense). decimalProtect: true, //do not allow assumption of decimals input without entering the radixpoint
Thank you for your time, @RobinHerbots! You have a fantastic library here =)
Just for clarification, is there a way to accomplish 1``5``0``0 instead of 1``5``.``0``0? Setting decimalProtect doesn't seem to do it.
decimalProtect: false will auto switch to decimals when the maximum number
of integer digits is entered. When setting true is will not continue in
the decimals until the radixpoint is entered.
You can accomplish the 1500 but not with the decimal extension. I
personnaly dislike typing 1500 when I mean 15.00, t doesn't feel right, but
more like that you are familiar with it.
Btw you do not have to click into the right part to enter cents, just type
the radixpoint and go on.
So typing
15 => 15.00
15
is't just the way you think
BUT if you really want the RTL shifting digits over integers, then open a
new issue, to make the numericInput work together with dynamic masks.
Then you can use a mask like "9{1,9}.9{2}", { numericInput: true, greedy:
false}} which should do what you expect besides the grouping.
best regards,
Robin
2014-09-15 20:00 GMT+02:00 Brett Dudo [email protected]:
Just for clarification, is there a way to accomplish 1500 instead of 15.00?
It's setting decimalProtect doesn't seem to do it.—
Reply to this email directly or view it on GitHub
https://github.com/RobinHerbots/jquery.inputmask/issues/644#issuecomment-55630810
.
Robin - I tried your suggestion to use $(input).inputmask("currency"); - and it works like a charm _except_ for the scenario where I type in a value whose last 2 integer digits are "00". Example 100, 100.00, 200, 1500.00. In these cases the input mask removes the first two integer digits (yielding 1.00, 1.00, 2.00, 15.00, respectively).
@dudo,
I have missed some part of you r message, as I repeated what you said, ... sorry for that.
@cstansbury,
Can you explain a bit more as I don't see a problem here!
@RobinHerbots - My apologies - I isolated the code in question and have determined that it's our code at fault. Everything looks great... Thanks for the great library!
No problem. Thx
@RobinHerbots Just for your information - the problem was due to the fact that we had code (that existed prior to using input mask) that would would listen to the input's change event and format the value. Apparently the inputmask doesn't like you changing the value during a blur/change event. The issue we were seeing here is reproduced via this fiddle: http://jsfiddle.net/cstansbury/4c8kup3f/2/.
@cstansbury ,
Thx for sharing, ... I will have a look at it, just to see if i can make my code more robust
@RobinHerbots ... Can we make the cursor default to the position to just left of the radix? It's currently |0.00, but it would seem to make more sense as 0|.00, and even blank out the first zero?
@dudo ,
I can do the caret positioning.
@dudo ,
In the latest verion this is already the case.
I'm on .26 now, but I can't seem to get the incantation correct. Sorry for seeming dense. =( How do you get the caret to default to just left of the radix? It doesn't seem to be the default currency behavior.
When you look at your initial jsfiddle and you click into the input. Where is the caret?
http://jsfiddle.net/msj5qfu1/5/ these are the options that I'm actually using.
to answer your question, the caret is in the correct location on the original fiddle, with the prefix.
@dudo ,
Ok check with the latest commit.
you're a fantastic person... do you have a beer fund I can donate to?
@RobinHerbots, I'm sorry... http://jsfiddle.net/msj5qfu1/6/
This text field is in a form, and the form is pre-populated with a value of 0.0, and upon form failures, and whatnot, will get updated with an appropriate actual value of 465.35 or whatever. That seems to break our use case...
@dudo ,
I've seen that you already found the beer fund ;-) Thx.
Yes,, .... I see I will have a look.
@dudo ,
The caret positioning to the caret should only be when the initial value is empty or equal to the template. when there is a value like 123.45, it should not, because otherwise you cant select a portion in the integer part or add a value before 2 for example.
@dudo ,
Ok fixed
More beer coming your way...
That fix worked, and all is well. Pressing the . to get over to the cents is no good for accounting folk, though, apparently.
Can we make an option for 'currency', {rtl: true}?
It'd function very similar to how it does now, except the caret would start 0.00| on the far right, and fill in the 0's as you typed? $15.50, just being 1``5``5``0, obviously.
Lemme know if I can help in any way.
@dudo ,
Ok this, is the start of a party ;-) Thx.
Why are the accounting folk against innovation?, ... because we all fear change.
Anyway see #651
I shall see if I can fit the rtl option into the existing currency alias. An other option is to use multiple masks.
see #644
Stack level too deep...
Is this a request for an update or something else? Or are you joking about the circular reference in the issues ;-)
Just playin'!
I noticed isRTL throughout the source code. I gave it a whirl with the currency alias, but no go. Sounds like you're close?
Well, rtl is already supported since version 1.x, BUT, ... it does not work
with complexer masks. Only due the fact that I cannot simply reverse the
mask.
Try any static mask and add the dir="rtl" attribute on the input or add the
numericInput attribute.
Anyway don't worry, I didn't forget. I first wan't to implement #564
2014-10-13 23:00 GMT+02:00 Brett Dudo [email protected]:
I noticed isRTL throughout the source code. I gave it a whirl with the
currency alias, but no go. Sounds like you're close?—
Reply to this email directly or view it on GitHub
https://github.com/RobinHerbots/jquery.inputmask/issues/644#issuecomment-58954022
.
Good point, i was playing around with that dir attribute once I saw it wasn't working and read the docs some more.
So, this really has to do with coins, right? Is the first key you press a dollar amount, or a coin amount (presuming your coins are all fractions of dollars). Maybe call this option coin: 'auto', but let the default behavior be coin: 'manual'?
Is there any way to implement the right to left yet? So it places the caret here 0.00| and if I type 150 it's 1.50?
Use numericInput option and define your mask 9.99
Thanks for the reply! Sorry I still quite can't figure it out. The ltr works great on numbericInput but is there a way I can also have a comma separator, allow a number up to 1,000,000.00 (or infinite would be fine to) and also have a prefix of '$'?
@mreinhart ,
That is on the list. I'm working on it.
@RobinHerbots any ETA on the above solution (numericInput with dynamic masks)?
My team and I are in need of this.
Thanks again for the great library.
+1
Didn't think pressing . would be such a big deal to people. I was wrong...
When we're dealing with people in finance, it is. It's a speed thing.
I ended up circumventing with these configs:
$('input').inputmask({
mask: '$ [9][9][9][9][9][9][9][9]9.99',
numericInput: true,
placeholder: '0',
greedy: false
});
It's not perfect, and has a limit with however many options 9's you put in, but it works for my needs. Hope that helps somebody!
Hi all,
$("#test1").inputmask("numeric", {
numericInput: true,
placeholder: '0',
groupSeparator: ',',
autoGroup: true
});
is more or less working. ... have a try and report the bugs in this issue.
Here is a fiddle I made that shows some bugginess. Thanks for working on this!
Thanks so much for the fixes! I still have the bugs that @NikKosse pointed out, should they be fixed? http://jsfiddle.net/msj5qfu1/22/
Strange who closed the issue?
@RobinHerbots Your commit message:
763df94942b5130dcf421aebda1b4f57ac79106d
:-)
Indeed the "fixes #644"
I have a question regarding the currency alias. I'm using it with _autoUnmask:true_ and _removeMaskOnSubmit:true_. Works great, but on submit I always get 0.00, even if the user has not touched the field. What would I need to do to ensure a blank value (no value or "") gets submitted when the user has not entered anything? I need to differentiate between 0 and no value.
Thanks in advance and great job to everyone involved!
@vercotux ,
I just fixed it for the currency alias.
@RobinHerbots There is still one problem with it. If you ente numbers, then click to a spot in the number and try to enter more, only the number directly to the left of the caret changes. See this fiddle: http://jsfiddle.net/msj5qfu1/43/
@NikKosse ,
Indeed, ... strange, .... I will have a fix asap.
@RobinHerbots ,
I want to mask default two digits after the decimal, But allow to enter up to four digits.
How can I achieve it?
Kindly, reply. Thanks in advance.
@GaikwadVikas please make a new issue, not related and this one is closed
Is there a way I can use the currency alias for input mask, but without any decimal places?
Most helpful comment
@vercotux ,
I just fixed it for the currency alias.