Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 02 22:04
    camilova commented #652
  • Oct 02 22:03
    camilova commented #652
  • Sep 28 01:19
    AlexandreBonneau labeled #655
  • Sep 28 01:19
    AlexandreBonneau labeled #655
  • Sep 28 01:18
    AlexandreBonneau closed #655
  • Sep 28 01:18
    AlexandreBonneau commented #655
  • Sep 27 13:15
    medspec opened #655
  • Sep 27 10:40
    AlexandreBonneau labeled #652
  • Sep 27 10:39
    AlexandreBonneau commented #652
  • Sep 27 10:12
    AlexandreBonneau closed #628
  • Sep 27 10:12
    AlexandreBonneau commented #628
  • Sep 23 07:45
    Travis autoNumeric/autoNumeric (next) errored (492)
  • Sep 23 07:42

    AlexandreBonneau on next

    Fix SSR import Makes the UMD b… (compare)

  • Sep 23 07:42
    AlexandreBonneau closed #648
  • Sep 23 07:35
    Travis autoNumeric/autoNumeric (next) errored (491)
  • Sep 23 07:32

    AlexandreBonneau on next

    Fix the eslint errors Signed-o… (compare)

  • Sep 23 07:13
    Travis autoNumeric/autoNumeric (next) errored (490)
  • Sep 23 07:11

    AlexandreBonneau on next

    Update the copyright dates and … (compare)

  • Sep 20 19:06
    AlexandreBonneau commented #181
  • Sep 20 18:44
    AlexandreBonneau commented #654
gmhawash
@gmhawash
What should newList be?
Dereckson Santana
@DerecksonS
@AlexandreBonneau I needed to do this, for some numerical values for Macedonia :) thank u
Alexandre
@AlexandreBonneau
@gmhawash you could do this in many ways. From the top of my head, I'd say you could select all .currency elements, then test each one with AutoNumeric.isManagedByAutoNumeric() to create your newList
or, you could add a special css class to all the AutoNumeric-initialized element, so you could then use '.currency:not(.anElement)' as the selector
perhaps you could use styleRules to set the css class (see https://github.com/autoNumeric/autoNumeric/#predefined-style-rules)
gmhawash
@gmhawash
@AlexandreBonneau Thanks for the great suggestions; I’ll try the last two options.
scorsy63
@scorsy63
I'm getting a 404 error with the autoNumeric cdn link
"Source map error: request failed with status 404 Resource URL: https://cdn.jsdelivr.net/npm/autonumeric@4.1.0"

I tried both of these links

<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.1.0"></script>
<!-- ...or -->
<script src="https://unpkg.com/autonumeric"></script>

in my header tags, but still get the same error
anyone know why?
Alexandre
@AlexandreBonneau
@scorsy63 does it happens in Chrome and Firefox?
do you have a reproducible test case?
scorsy63
@scorsy63
@AlexandreBonneau It's working now, the problem was I was using a old version of the CDN link
Alexandre
@AlexandreBonneau
great!
solernelson
@solernelson
hello, when I use autoNumeric with chrome on a samsung tablet, the option 'maximumValue' is not repeated.
hello, when I use autoNumeric with chrome on a samsung tablet, the 'maximumValue' option is not repeated, is this problem known?
Alexandre
@AlexandreBonneau
@solernelson what do you mean by 'not repeated'?
Jimmy Wärting
@jimmywarting
did someone else realize how large this dependency is? absolutely crazy!
I would just use intl.NumberFormat: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat
Alexandre
@AlexandreBonneau
well, you use what you need really
and intl.NumberFormat is far from AutoNumeric feature-wise
also, there are a ticket open on github @jimmywarting ; autoNumeric/autoNumeric#469
Ideally it would be great if you could just select each feature you want, and have a build generated for you automatically
but that's not a priority right now
kishorepaila
@kishorepaila
Hello, numpad decimal input ..does not work only in IE11...is this already reported?
yonihbc
@yonihbc

Hi,
I have been using version 2 and now i have encouraged a problem with version 4.

I have multiple items:
new AutoNumeric.multiple('.itemDiscount', {
"maximumValue": "100",
"minimumValue": "-100",
"suffixText": "%"
});

i used autoNumeric("set",value) but now i need to change it and both not working for me
$(".itemDiscount[data-path]").set(discount); //non gets set
AutoNumeric.getAutoNumericElement(".itemDiscount[data-path]").set(discount); //only the first one gets set

Alexandre
@AlexandreBonneau
@kishorepaila I don't recall seeing that one, no
@yonihbc you are trying to use a jquery set method, which does not exist
if you want to change the value of an AutoNumeric-managed element, the best way is to keep a reference to such element in order to do an.set(discount) later on
new AutoNumeric.multiple('.itemDiscount', yourOptions); retourns an array of such references, for info
if you did not keep a reference to your AutoNumeric-managed elements, then you will indeed need to 'search' those again, and indeed, AutoNumeric.getAutoNumericElement() is singular and will only get the very first elements
perhaps I could create a AutoNumeric.getAutoNumericElements() (plural) that would return an array of those elements? I'm not sure
Alexandre
@AlexandreBonneau
couldn't you use [... document.querySelectorAll('.itemDiscount[data-path]')].forEach(an => AutoNumeric.getAutoNumericElement(an).set(yourValue);}? or something equivalent?
Amjad Khan
@amjadkhan

Hi, there must be a simple answer to this. I need an input with currency symbol '£', empty value £25,000, min value £25,000, max value £10,000,000 and no decimal places. This config just does not allow me to enter anything.

What am I doing wrong ?

{
currencySymbol: "£",
decimalPlaces: 0,
emptyInputBehavior: "25000",
maximumValue: "10000000",
minimumValue: "25000"
}

Alexandre
@AlexandreBonneau
@amjadkhan well, you are not doing anything wrong here. There is an open issue (autoNumeric/autoNumeric#543) that address that limitation (when setting a minimum value higher than 0), as you saw
AdrienAtHome
@AdrienAtHome
Hi all, I'm currently having issue with window behavior does not exists on react server-side application. This issue could be resolved by proposed PR autoNumeric/autoNumeric#648.
Do you think you could patch this soon ?
Thanks in advance.
taylor85p
@taylor85p

Hello every one,
Autonumeric is not working on input, I know i am not doing it right, Please i need help.

I only want the raw data to be submitted to the database for further calculation after formatting.
Where can i get a link to a step by step usage of this plugin, code below.

Thanks a lot

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.1.0"></script>

<script type="text/javascript">
$(document).ready(function(){
new AutoNumeric('#input', {
currencySymbol : '$',
decimalCharacter : ',',
digitGroupSeparator : '.',
});
</script>

</head>
<body>

<form>
<input type="text" value="" id="input"/>
</form>

</body>
</html>

Alexandre
@AlexandreBonneau
@AdrienAtHome I'm currently without a proper internet connection, so I'm not able to work on AutoNumeric currently.
I should get back Internet in about 2 weeks, sorry
Hey @taylor85p, first, you do not need jquery anymore to use AutoNumeric. I would suggest putting your script tag after the body one, just to be sure everything is loaded
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