Re: [SMARTY-DEV] New plugin

From: Date: Tue, 27 May 2003 15:35:19 +0000
Subject: Re: [SMARTY-DEV] New plugin
References: 1 2 3 4  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1515@lists.php.net to get a copy of this message
Since I coded the same plugin for one of my apps I can suggest the name "kbsize" :-) ----- Original Message ----- From: "Patrick Emond" <patrickemond@softhome.net> To: "Smarty Dev" <smarty-dev@lists.php.net> Sent: Tuesday, May 27, 2003 6:12 AM Subject: [SMARTY-DEV] New plugin > Hi folks, > > I've attached a new modifier plugin that I thought some of you may find handy. It rounds a number to two orders of significance and adds it's size prefix (similar to adding the -h option to an linux ls command). It supports up to a Yotta (1e24) in size. > > For example: > > 13990 -> 14.0K > 4520000 -> 4.5M > 123 -> 123 > etc. > > Simply use like any other modifier: {$variable|size_postfix} > > The name isn't so good so if anyone can think of anything better to call it please let me know. > > > > -- > Patrick Emond <patrickemond@softhome.net> > ---------------------------------------------------------------------------- ---- > -- > Smarty Development Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.dev (#1515) next »