Number Formatter

Developer

Douglas Green

3rd Party (Free)

683 downloads (last 90 days)

Creative Commons Attribution No Derivatives Download v2.0

EE Version Support

  • ExpressionEngine 2
  • ExpressionEngine 3

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

  • Updater
  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Content Elements
  • Better Workflow
  • Matrix
  • Grid
  • Webservice
  • Publisher

Requirements

  • jQuery for the Control Panel

Add-On Type(s)

Plugin

Tags

Sends a value through the PHP number_format() function, and returns a formatted number.

The Number Formatter plugin accepts a value as a number, runs it through the PHP number_format() function, and returns the formatted result.

Basic usage:

{exp:number_formatter:format}
{value}
{/exp:number_formatter:format}

The plugin accepts the following parameters, which correspond with the PHP number_format() function parameters:

- number: number to be formatted, passed as value between opening and closing plugin tags, required
- decimals: number of decimal points, optional, 0 by default
- dec_point: decimal point separator, optional, ‘.’ by default
- thousands_sep: thousands separator, optional, ‘,’ by default

As with the PHP function, pass a number alone, a number and the number of decimals, or all 4 parameters. 3 parameters are not accepted.

Plugin with parameters:

{exp:number_formatter:format decimals='2' dec_point='.' thousands_sep=','}
{value}
{/exp:number_formatter:format}

Download Number Formatter

EE Support Downloads Add-On Version Release Date
2.5.0+ Download 2.0 Aug 28, 2012

Number Formatter Links

This entry was created August 30, 2012, 10:19 am.
This entry was last updated October 25, 2017, 12:57 pm.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.

3 Reviews:

koivi 10.01.17

koivi
Rating - {addon_rating_average}

Simple, bet gets the job done. When using with ee3, change line 29 to read:
$this->EE = ee();

Tylonius 09.14.17

Tylonius
Rating - {addon_rating_average}

This worked great under EE2, but under EE3, it doesn’t work at all and throws the following error message:

“Only variables should be assigned by reference

user/addons/number_formatter/pi.number_formatter.php, line 29”

MajesticIX 05.24.13

MajesticIX
Rating - {addon_rating_average}

Simple plugin but it works. Was combining this with an EE SQL query and required formatting a number using an EE variable which wouldn’t work with a simple PHP injection without hackery. Problem solved. Thanks.