OVERRIDING THE DEFAULT COLUMN TYPE IN YOUR DATABASE TO DECIMALS? - Aug 4th, 2010


Zaba had that request and Dave said:

If you want to actually override the mysql column type you can specify that in CMS Builder's schema file directly in
/data/schema/yourSection.ini.php like this:



customColumnType = "int(10) unsigned NOT NULL"



You can have a look at /data/schema/uploads.ini.php for an example where you’ll find:



[order]
order = 2
customColumnType = "int(10) unsigned NOT NULL"



Saginetics added:
You can also try:



<?PHP echo number_format($record['number'] ,2) ?>



The ",2" tells it to give two decimal places (you can change this to 8)

The "number_format" tells it to treat it like a number to include comma separators.

If you plan on sorting by numbers, then use this:



'orderBy' => 'price+0 DESC',




The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service