🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

pcsFormatNumber is a super tiny number formatting plugin that automatically formats currency (money) as you type on a number input.

number-format currency

Documentation

Demo: https://pasquale-cs.github.io/format-number/


[EN] - Plugin format number for jQuery

Plugin format number with currency for jQuery

Include "js/pcsFormatNumber.jquery.js" in your project and use the function "$(selector).pcsFormatNumber()" in your script.

Example include plugin (JS):

<body>   ...   <script src="js/pcsFormatNumber.jquery.js"></script>   ... </body>

Example use function:

<body>   ...   <input class="pcs-format-number" type="text">   ...   <script>     $(document).ready(function() { 			$('.pcs-format-number').pcsFormatNumber({	// Set selector for input element (ID or Class) 	      decimal_separator: ".",					        // Set copy element 	      number_separator: ",",					        // Set button for copy element 			  to_fixed: 2,							              // Set fixed of decimal 			  currency: "€"							              // Set currency (€, $, £...) 			}); 		});   </script>   ... </body>

Do you Like!

Give me a coffee: https://www.paypal.me/pasqualecs Thank you =)


[IT] - Formattare un numero con jQuery

Plugin per la formattazione di un numero.

Includere il file "js/pcsFormatNumber.jquery.js" net tuo progetto e usare la funzione "$(selector).pcsFormatNumber()" nel tuo script.

Esempio per l'inclusione del plugin (JS):

<body>   ...   <script src="js/pcsFormatNumber.jquery.js"></script>   ... </body>

Esempio per l'uso:

<body>   ...   <input class="pcs-format-number" type="text">   ...   <script>     $(document).ready(function() { 			$('.pcs-format-number').pcsFormatNumber({	// Set selector for input element (ID or Class) 	      decimal_separator: ".",					        // Set copy element 	      number_separator: ",",					        // Set button for copy element 			  to_fixed: 2,							              // Set fixed of decimal 			  currency: "€"							              // Set currency (€, $, £...) 			}); 		});   </script>   ... </body>

Ti Piace!

Mi offri un caffè: https://www.paypal.me/pasqualecs Grazie =)


You May Also Like