Featured Articles

4.380 PHPDug, Pligg and Scuttle Websites List – Free

Get a list of 4.380 Pligg, Scuttle and PHPDug Social Bookmarking websites for free!

SEO Booster PRO v. 1.9.2.3

SEO Booster PRO v. 1.9.2.3 has just been released. This update is a recommended update, and has a[...]

WPDT: number_format_i18n Function Reference and Usage

by Lars Koudal on 26/06/2009

43 views so far.

Share

WordPress Development Tip

In a previous post, I wrote about the usage of the date_i18n function in WordPress. This post will address how to properly format displaying values (numbers) according to the WordPress blog settings.

The function to use for this is number_format_i18n.

The usage is much easier than the date-function, as it is a simple function that accepts only a single parameter, the value to be displayed.

Usage:

echo number_format_i18n("4121124");

The output will display the number 4121124 in the correct localized format for your blog.

Popular Searches
number_format_i18n, wordpress format number,

{ 1 comment… read it below or add one }

Brent Shepherd November 25, 2009 at 04:06

Lars, thanks for publishing this post. I hadn’t realised until today there was a function to easily take care of number formatting. The more discussion on it the better!

One correction, number_format_i18n can optionally take a second parameter – $decimals – representing the number of decimals to include.

Reply

Leave a Comment

PRIVACY POLICY: Your privacy is important to us. We will never sell or rent your email address and you can unsubscribe at any time.

Previous post:

Next post: