PrettyNumber – A jQuery Plugin for Formatting Numbers

Here’s a jQuery plugin that transforms a number into a human readable format. This plugin formats a number like 23454321234 into 23.454.321.234 . You can use different delimiters like the […]

Here’s a jQuery plugin that transforms a number into a human readable format. This plugin formats a number like 23454321234 into 23.454.321.234 . You can use different delimiters like the comma, dot, space or anything you specify in the plugin.

Here are some examples of how to call the plugin:

<div id="number1">1234567123672</div>
<div id="number2">12345622237123672</div>

a)

$("#number1").prettynumber();
//it would output 1.234.567.123.672

b)

$("#number2").prettynumber({
delimiter : ','
});
//it would output 12,345,622,237,123,672

Download source

Tiny break: 📬 Want to stay up to date with frontend and trends in web design? Check out our Collective and stay in the loop.

cody

Cody loves jQuery - he puts the magic into every web application. He is crazy about Curry dishes.

The
New
Collective

🎨✨💻 Stay ahead of the curve with handpicked, high-quality frontend development and design news, picked freshly every single day. No fluff, no filler—just the most relevant insights, inspiring reads, and updates to keep you in the know.

Prefer a weekly digest in your inbox? No problem, we got you covered. Just subscribe here.

Feedback 1

Comments are closed.
  1. Pingback: uberVU - social comments