Welcome Guest, Not a member yet? Register   Sign In
Table generation from SQL query removes trailing zeroes
#1

[eluser]linker3000[/eluser]
Hi,

I have an SQL query involving a PIVOT that returns a stock pricing table that's output with $this->table->generate($result). The query runs fine but the resulting table output removes all trailing zeroes and decimal points so that an item priced at 5.00 shows as just '5'.

In the SQL query, the data is formatted with a CAST to fix it to two decimal places and it works fine when run in the SQL development tool. I can't change the SQL query because the PIVOT only operates on numeric data.

Is there a way of telling the table library to leave the zeroes and points alone, or do I need some pre-processing before I send the data out as a table?

Thanks
#2

[eluser]InsiteFX[/eluser]
Take a look here:
sprintf

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB