- AdvSearch
- cookieJar
- getYoutube
- aliasid
- AddHeaderfiles
- AjaxUpload
- amazonSES mailing list
- Analytics
- Archivist
- Articles
- Babel
- BannerX
- BannerY
- Batcher
- bdListings
- boilerX
- BreadCrumb
- Breadcrumbs
- BxrExtra
- cachebuster
- CamperManagement
- Church Events Calendar
- Cliche
- ClientConfig
- CMPGenerator
- Collections
- ContextRouter
- CookieList
- CronManager
- cssSweet
- CustomUrls
- Databackup
- Discuss
- DitsNews
- Eletters
- EventManager
- eventsCalendar2
- EventsX
- ExerPlan
- fastField
- FileDownload R
- FileLister
- FirstChildRedirect
- Flexibility
- ForcedPasswdChange
- FormIt
- FormIt2db
- FormitFastPack
- FormSave
- FoundationX
- FX2themebase
- Gallery
- GatewayManager
- gCal
- getDate
- getFeed
- getPage
- getRelated
- getResourceField
- getResources
- getUrlParam
- getRTImages
- getVimeo
- GoogleSiteMap
- GridClassKey
- HandyMan
- Hits
- HitsPage
- HybridAuth
- If
- Image+
- imageHERE
- ImageStyles
- ImportX
- LexRating
- Lingua
- Login
- Loginza
- mChimpX
- MetaX
- mhPayPal
-
MIGX
- MIGX.Backend-Usage
- MIGX.Data-Entry
- MIGX.Frontend-Usage
-
MIGX.Tutorials
- MIGX.Fancybox-images with seperate placeholders in Richtext-Content
- MIGX.Simple opening hours table
- Using resource-specific mediasource and multifile-uploader with MIGX
- MIGX.Varying layout-boxes
- Creating Selectable and Sortable lists for MIGX
- MIGX.sortable resourcelist
- Using resource-specific mediasource and multifile-uploader with MIGX
- MIGX.Using Grid Inline Editing
- MIGXdb
- MinifyX
- miniShop
- modActiveDirectory
- ModDef
- modExtra
- modMobile
- modSwiftMailer
- mxCalendar
- mxExtendedMenu
- mxFormBuilder
- mxHasTvs
- MoneyBird
- ObfuscateEmail-Revo
- PackMan
- PageBreaker
- Peoples
- PHP Tidy (plugin)
- phpThumbOf
- Polls
- POI Manager
- QuickCrumbs
- Quip
- Rampart
- Redirector
- renderResources
- ResourceWatcher
- RezImgCrop
- Rowboat
- sekFancyBox
- sekFormTools
- sekSiteTools
-
sekUserGalleries
- sekUserGalleries.album.items.helper
- sekUserGalleries.album.items.manage
- sekUserGalleries.album.manage
- sekUserGalleries.album.view
- sekUserGalleries.browse.galleries
- sekUserGalleries.directory
- sekUserGalleries.image.information
- sekUserGalleries.search
- sekUserGalleries.users.gallery.manage
- sekUserGalleries.users.gallery.view
- selfLink
- Shopkeeper
- siblingNav
- SimpleSearch
- SiteEditor
- sitemapFriend
- Slideshow Manager
- sLink
- SmartOptimizer
- SmartTag
- StatCache
- SocialLogin
- SocialSuite
- spieFeed
- StaticSaver
- StoreLocator
- SubscribeMe
- SyntaxChecker
- Tagger
- TaggingAtoZ
- tagLister
- TinyMCE
- Upload to Users CMP
- VersionX
- virtuNewsletter
- VisionCart
- Wayfinder
- xFPC
SocialSuite.prettyNumbers
SocialSuite is a collection of useful tools for integrating various social media into your MODX website.
prettyNumbers is an output filter, part of SocialSuite, which formats numbers nicely depending on the size of the number. It can also be used as a standalone snippet by passing a number into the input property.
Basic Usage
Assuming [[+count]] returns a number, you just add the prettyNumbers output filter to it:
[[+count:prettyNumbers]]
and it will be prettyfied.
When you want to parse the result of a snippet, you can also just use the output filter syntax, for example with getFacebookShares.
[[!getFacebookShares:prettyNumbers? &url=`http://google.com/`]]
As a standalone snippet, the syntax is slightly different in both scenarios:
[[prettyNumbers? &input=`[[+count]]`]] [[prettyNumbers? &input=`[[!getFacebookShares? &url=`http://google.com/`]]`]]
Advanced Usage
You can also specify options to the output filter or snippet to change how it formats the number. These are as follows:
Option Key | Default | Description |
---|---|---|
case | lower | When set to "u", "ucase", "upper" or "strtoupper", this will change the suffix (k, m, b) to uppercase. |
decimal | . (dot) | A string to use as decimal separator. |
thousands | , (comma) | A string to use as thousands' separator. |
You specify these like this:
[[+count:prettyNumbers=`case=upper&decimal=,&thousands=.`]][[prettyNumbers? &input=`[[!getFacebookShares? &url=`http://google.com/`]]` &options=`case=upper&decimal=,&thousands=.`]]
How numbers are formatted by default
5 => 5 515 => 515 5141 => 5.1k 5151 => 5.2k 51415 => 51k 51515 => 52k 515151 => 515k 5151515 => 5.2m 51515151 => 52m 515151515 => 515m 5151515151 => 5.2b 51515151515 => 52b 515151515151 => 515b 5151515151515 => 5,152b 51515151515151 => 51,515b 515151515151515 => 515,152b
Suggest an edit to this page on GitHub (Requires GitHub account. Opens a new window/tab).