by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 16 11:29
    jarciano commented #694
  • Sep 13 22:16
    AlexandreBonneau commented #607
  • Sep 12 21:46
    DanielRuf closed #607
  • Sep 12 21:42
    DanielRuf closed #606
  • Aug 20 12:18
    Diamentix commented #684
  • Aug 20 12:17
    Diamentix commented #684
  • Aug 13 11:39
    adrianmroz commented #553
  • Aug 13 11:23
    adrianmroz commented #553
  • Aug 11 18:54
    AlexandreBonneau closed #700
  • Aug 11 18:54
    AlexandreBonneau commented #700
  • Aug 11 18:51
    AlexandreBonneau commented #700
  • Aug 11 18:51
    AlexandreBonneau edited #700
  • Aug 11 18:47
    AlexandreBonneau labeled #700
  • Aug 11 18:47
    AlexandreBonneau labeled #700
  • Aug 10 19:39
    cambronjay commented #700
  • Aug 10 19:32
    cambronjay commented #700
  • Aug 10 19:31
    cambronjay edited #700
  • Aug 10 19:26
    cambronjay commented #700
  • Aug 10 19:26
    cambronjay commented #700
  • Aug 10 19:24
    cambronjay opened #700
Alexandre
@AlexandreBonneau
if you want to submit raw numbers, then check the formSubmitJsonNumericString() function for instance
there are other form-related functions you can check here
Mikołaj Wolicki
@MIKOLAJW197
Hi! I have question about configuring Autonumeric.js, cause I have little problem. Is it possible to configure it like this: {
decimalCharacter: ",",
decimalCharacterAlternative: ".",
digitGroupSeparator: " "
} BUT! also add and option when I paste for example value 10.12 it will change it for 10,12 ? (Now it is changing it for 1 012,00, which in my case is wrong behaviour). Hope to hear from you soon! :)
Alexandre
@AlexandreBonneau
hey @MIKOLAJW197 , mention me next time I'll better see your message!
about what you are asking, it indeed would seem logical if you paste a . that it would convert it to a , since no points are used as the digitGroupSeparator
could you please open an issue about that?
Mikołaj Wolicki
@MIKOLAJW197
Hi! @AlexandreBonneau I think there is Issue opened - autoNumeric/autoNumeric#424. I just used the idea from 'vecss' comment and it worked fine.
Alexandre
@AlexandreBonneau
ah indeed
Gabriel Stellini
@gabrielstellini
@AlexandreBonneau is leadingZero:'keep' working?
If I try it out here:
I can enter values with a leading 0
But once I click away, they disappear
ABRAHAM Morgan
@Geekimo
Hello,
is there a way for an input to support both percentages and number values ?
I'm in a case that a user can type a plain value or a percentage, but I can't find a way to support both.
linhnvhicts
@linhnvhicts
Hi, i just recently use your js library and it's wonderful! Now i'm trying to implement it with input range in a form and i'm currently having trouble with setting the raw value , i already made a question of this topic on SO https://stackoverflow.com/questions/58481789/jquery-using-autonumeric-with-slider-range . If you can take a look that would be awesome :)
wesleyi23
@wesleyi23
Noob question: I have a complex group of forms with prepopulated values. Is there a nice clean way to get the initial values from each form field and add them to AutoNumeric?
Alexandre
@AlexandreBonneau
@Geekimo unfortunately no; an input only has one set of option at anytime. However you could create a script to update those options on the fly based on your personal conditions
Thom Dunaway
@td234

Noob question: I am trying to initialize this for multiple inputs and want the NorthAmerican options. Here is what I have tried.

This works, but no dollar signs

    new AutoNumeric.multiple('input.rate', { modifyValueOnWheel: false });

These do not work

    new AutoNumeric.multiple.northAmerican('input.rate', { modifyValueOnWheel: false });
new AutoNumeric.multiple.northAmerican('input.rate', { modifyValueOnWheel: false }, dollarPos);

Any help is greatly appreciated.

Alexandre
@AlexandreBonneau

@td234 you can use the following :

new AutoNumeric.multiple('input.rate', ['dollar', { modifyValueOnWheel: false }]);

If you want only positive numbers, try :

new AutoNumeric.multiple('input.rate', ['dollarPos', { modifyValueOnWheel: false }]);
May Weather
@namnguyen2091
I dont want to set minimumValue but I have a range number, and then when I clear input, instead of display min value or previous value, I want to it display empty and onchange event is always fire. How should I do?
Thom Dunaway
@td234
@AlexandreBonneau Thank you!!
taianrj
@taianrj

Hello! I'm trying to use the 'change' event, as I see that Vue AutoNumeric supports it, but it's not working, the event is not called.

<vue-autonumeric v-model="Produto.PrecoFob" v-on:change="atualizarCalculos"></vue-autonumeric>

If I use 'input' event, it is called.

What can I do to make change event work?

Alexandre
@AlexandreBonneau
@taianrj would you have a codepen to show us the problem?
@namnguyen2091 what is your range? Is 0 included in that range? Do you have a codepen that shows the behavior you are describing?
oscaroxy
@oscaroxy
Hi, I would to union autoNumeric with jQuery, but don't find how. I used autoNumeric 1.9 like $dom.autoNumeric('get'); I would to have something similar in order to not change all whole code of my project (it's big). Do it exist?
oscaroxy
@oscaroxy
I saw jQuery.data(...) in order to union $dom element of jQuery with anElement of autoNumeric, but I think this solution hasn't a good performance.
Alexandre
@AlexandreBonneau
@oscaroxy check out our guide to migrate from the old unsupported 1.9* to version 4 : https://github.com/autoNumeric/autoNumeric/blob/next/doc/HowToUpgradeToV4.md
I'd say you do not need to 'union' jquery and AutoNumeric (the jquery dependency has been dropped for a simple reason ; jQuery is not much needed anymore with all the major browser supporting more or less the latest html/css/js standards)
please go have a look at the guide, and come back here if you have any further questions
oscaroxy
@oscaroxy
thanks for the reply, but when I apply autoNumerti to $('.currency'), after I have to populate my Model Object, How do I get the value of autoNumeric?
I try this: $('.currency').each(function(){
var myObj.value = AutoNumeric.getAutoNumericElement(this).get();
});
without change many code from my project... this was the reply of my question. Thanks @AlexandreBonneau, I love AutoNumeric :-)
Alexandre
@AlexandreBonneau
well, first you would initialize AutoNumeric like this : let an = new AutoNumeric('.currency')
then if you want to get the value of that single field, then you can get the value using all the get* variants, like let myVal = an.getNumericString()
(or getNumber(), or getFormatted() etc.)
do note that, as stated in the migration guide, using new AutoNumeric('selector') will initialize only the very first element it finds with that selector
if you want to initialize multiple DOM elements, then you need to use let anArray = AutoNumeric.multiple('.currency')
Alexandre
@AlexandreBonneau
then if you want to get all the value of all those elements, you already have all the references to the AutoNumeric objects in anArray, so you could do:
anArray.foreach(an => console.log(an.getNumber()));
it really depends on what you want to do with those values
if you want to submit them, then take a look at the new form* functions :)
oscaroxy
@oscaroxy
I thank you again for the reply, I'll continue to use autoNumeric, now with version 4 :-)
Alexandre
@AlexandreBonneau
you are welcome @oscaroxy
Takumi07
@Takumi07

Hello @AlexandreBonneau , how are you?
I am currently using the plugin in a Blazor solution.
I have configured it so that the digitGroupSeparator is dot "." and the decimalCharacter is comma "," with two decimal places. Example: "1.000,50".
I have a problem when using the binding provided by Blazor, because numbers on the server are dotted as a decimal, like "1000.50".
When the plugin initializes, it works fine allowing me to enter for example "1.000,50", but when having applied this initialization format to the control, Blazor wants to apply a number like "1000.50", the text box remains as "100.050,00".
Do I have a solution for this behavior? I really need it to be displayed with comma decimal separator and I can't use Jquery to set the values because I need to use blazor.

Thank you very much and apologies in advance for my terrible English.

Matías Pablo Bordoy
@MatiasBordoy

hi, im using the autonumeric plugin in a .net Blazor App. I have an issue when submitting the form, the plugin SOMETIMES resets the value to the previous value.

If i don't use autonumerics it works well with a normal input.

This only happens when the form is submitted withouth loosing focus.
But it happens like 1 o 20 times.

I tried a lot of fixes no one worked..

Alexandre
@AlexandreBonneau
@Takumi07 Which options are you using for initializing your AutoNumeric elements?
I never used Blazor myself, so I'm not versed in how it works internally. However from what you are describing, Blazor tries to control the input, which you should not allow. Perhaps do not declare the input as a number input so that Blazor do not touch it?
@MatiasBordoy hey, weirdly I never heard of blazor until now, and you both are asking question about it here :)
Would you have a reproducible test case?
Guobacai
@Guobacai
Hello,
I have a use case that the padding is set to true and the decimalPlaces is set to 2.
When user inputs 12.2, we want it to be formatted to 12.20.
But, it could also allow users to input decimal numbers more than 2. for example: 12.232.
I couldn't find an official way to do so. So, I think I can get user's input and reset the setting decimalPlaces.
However, I can't find a good way to get 12.232 instead of 12.23.
Is there any way that I could get user's raw input?
Guobacai
@Guobacai
Or, is there any way I can get user's raw input and decide how the number should be formatted?