This topic is locked
[SOLVED]

 Search results will not format

11/18/2009 9:41:37 PM
PHPRunner General questions
J
jrwatsio author

I've tried multiple techniques for customizing the format of my numeric columns and triple-checked the mysql table for proper formatting (ported from an Access database table to Mysql using Bullzip's 'Access to Mysql'). When I run a query on the advanced search page, the resulting list page comes back with the all the numbers formatted to 5 digits right of the decimal (my computer's default setting). When I go to 'View As' as recommended by the help page and highlight the fields I want to format, the screen reads 'No properties available'. How do I control the numbers to the right of the decimal? So far I can only get it to display whatever setting my computer's set at. I'd rather have more values than too few but I know I should be able to control each column's format. (using phprunner 5.1 build 2503). Thanks for any help.

Sergey Kornilov admin 11/18/2009

Set 'View as' type to 'Custom' and use the following code:

str_format_currency(number_format($value,5))

J
jrwatsio author 11/19/2009



Set 'View as' type to 'Custom' and use the following code:

str_format_currency(number_format($value,5))


Thanks for the feedback, I thought that might be where I could set the formats. I just couldn't find the format syntax so searching on your suggested string, I found other discussions in the forum. I am using '$value = number_format($value,#); ' where # is the desired decimal accuracy. It works but unfortunately the 'Null' fields now read '0.00'. Is there a conditional to keep Null cells empty and only format '0' when it is an actual value?

Thanks for your help.
Actually, I am trying 'if ($value<>Null)' before the format statement to see it that will add the not-Null condition.
Update: that worked - thanks again Sergey.