Ability to cut trailing zeroes from field value being displayed

4 views
Skip to first unread message

Alexander Obuhovich

unread,
Oct 17, 2011, 6:39:26 AM10/17/11
to In-Portal Development
In-Portal has powerful number formatting engine, that allows to format numbers, stored in database in the way you need using sprintf function.

However I recently stumbled upon situation, where I need to remove trailing spaces from a formatted number, that was displayed, e.g. make "545.00" appear as "545", but keep "345.22" as is.

Patch attached gives ability to enable such behavior for any database field needed via adding "cut_zeros" option to field definition in unit config.



Ready for testing.

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com
cut_zeros_number_formatting.patch
Reply all
Reply to author
Forward
0 new messages