npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ak_price_input

v1.0.1

Published

This helps you to format your prices into an input and when asked, it retrieves the price into the correct form. For instance if user type (or is passed dynamicaly to the input) 2500000000, this plugin displays 2 500 000 000 (if seperator is ' ') and when

Downloads

6

Readme

input-price

Helps yout to format your prices in your inputs

This is a jQuery Plugin

  • Maintain all your css stylisation
  • Very simple to deploy
  • ultra Heavy
  $(yourElement).inputPrice(milleDelimitter = ' ', decimalDelimiter = ',')

The test is given to see it an action

What this is?

This is a jQuery plugin helping you to format your prices into an input and when asked, it retrieves the price into the correct form. For instance if user type (or is passed dynamicaly to the input) 2500000000, this plugin displays 2 500 000 000 (if seperator is ' ') and when the input value is required, the plugin retrives 2500000000.

Installation

Via npm

npm install ak_price_input

By loading js file

Only file you file you have to load in the page you want to use this is inputPrice.js. Just copy the file and insert it into your project and refer it into your project

How this works

His principle is simple. This replace the target element by a clone keeping thus all it'attributes and then all the styles you had applied. After that clone is placed before the target element. All changes done on clone element are repercuted on the target element, since their values are always equivalent. Anyway, some of these attributes can are changed

For the target element

  • type passes to hidden

For the clone element

  • type is changed into number
  • pattern attribute is modified or (set if not exists) into the pattern waited, regarding also the separator passed as plugin parameter
  • id attribute is removed. (To avoid have 2 same id on your page)

Cautions

Since id attribute is removed on the new input which is displayed on your page (the clone input) and type changed into number, ensure your original input style is not only based on it id (mean #yourInputId {...} in your css file), same for the type attribue (mean input[type="yourOriginalType"] {...} or in this particular case ensure both rules are applied on input[type=["number"]. If you use basically some toolkit such as Bootstrap, you don't have to care about that.

See it in action

See it in cation via this link https://codepen.io/achenguikemo/project/editor/XRGOOj

ENJOY :-)