Forum Moderators: coopster

Message Too Old, No Replies

Problems with Float 6,2

Displaying prices - DWMX

         

curlykarl

4:25 pm on Jun 19, 2003 (gmt 0)

10+ Year Member



Hi all

I don't really know how to explain this so please bear with me :)

I have a recordset in DWMX set up like this :

{rs_item_1} {rs_price_1}
(rs_item_2} (rs_price_2}

this goes on until I get to recordset 20

The problem is not all of the info I pull from my database has 20 records, some have as little as 5

So I end up with a rather ugly page display like this

item 1 - 1.50
item 2 - 3.86
..........- 0.00
..........- 0.00

What I wanted to do was set a behavior that hides the zero prices, and just shows the relevant records, but the behaviour doesn't work because the cells are not empty, they have the price set to zero by the database

I belive it has something to do with the way I have set the database up, I have used float (6,2)

When I upload the data through PHPmyadmin the blank cells in excel default to 0.00 so the recordset displays 0.00 even though the cell's were empty when I uploaded the spredsheet

Does anyone know how to change it so that blank cells stay blank and not default back to zero.

It all works fine but looks ugly :(

Thanks for your time

Karl :)

DrDoc

5:06 pm on Jun 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about something like:

if($price) {
// float stuff in here
}

That way, if $price is blank it won't be displayed as zero...

curlykarl

6:12 pm on Jun 19, 2003 (gmt 0)

10+ Year Member



Sorry DrDoc you've lost me there?

I think it's to do with my database and not my code, I'm a cheater with code I use Dreamweaver to genarate it for me :)

I've had a look through and I can't see a place to insert your suggestion in.

It looks like it's back to the drawing board :(

Karl