 |

zaba
User
Nov 26, 2008, 7:22 AM
Post #1 of 4
(414 views)
Shortcut
|
|
Changing field type to decimal 8,2
|
Can't Post
|
|
Hi, I want to have a specific field type, in this case decimal, as I am performing calculations on that field. I can manually change it by doing it directly on the mysql database (using CocoaMySQL - a MySql GUI for Mac OSX). I would like to have this as an option in cms builder. If I make any changes in cms builder it reverts back to the default field type. Do I have to alter the ini file for that particular category?
|
|
|  |
 |

sagentic
User

Nov 26, 2008, 8:48 AM
Post #2 of 4
(411 views)
Shortcut
|
|
Re: [zaba] Changing field type to decimal 8,2
[In reply to]
|
Can't Post
|
|
Hi zaba - I'm not quite sure what your are trying to accomplish but maybe this will help: <?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', Let us know if that doesn't help and we can take it from there. Kenny
|
|
|  |
 |

Dave
Staff
/ Moderator

Nov 26, 2008, 9:21 AM
Post #3 of 4
(407 views)
Shortcut
|
|
Re: [zaba] Changing field type to decimal 8,2
[In reply to]
|
Can't Post
|
|
Hi zaba, 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. Hope that helps! Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

zaba
User
Nov 26, 2008, 9:36 AM
Post #4 of 4
(406 views)
Shortcut
|
|
Re: [Dave] Changing field type to decimal 8,2
[In reply to]
|
Can't Post
|
|
Thanks Dave, I'll give it a whirl and see what happens.
|
|
|  |
|