I am entering and displaying some big numbers in some fields - 16000000 for instance. Is there an easy way to have that displayed on screen as 16,000,000?
Many thanks
Neil
Numeric display formats
7 posts
• Page 1 of 1
Hi Neil,
You can customize the display of any field using delegate classes by implementing a method of the following form: function fieldname__display(&$record){} for example, say we have a field named 'price', and we want to format it nicely, we would implement a method as follows:
Above examples used the php number_format function (http://php.net/number_format) to format the number nicely using commas and decimals... Hope this helps. -Steve
Forms are a little more complicated because there is a two-way going on. If you alter the display in a text field, you must be able to parse the value back to something acceptable by the database. This can be achieved using a combination of the fieldname__pushValue() and fieldname__pullValue() methods, described in this how to: http://framework.weblite.ca/documentation/how-to/how-to-define-custom-serialization-for-fields
Hope this helps a little. -Steve
Hi Neil,
I'm currently up to my knees in the entrails of Dataface so I can't check this bug out... but I'll take a look in the next few days to see why it's not working... it is supposed to work... Best regards Steve
7 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 23 guests |